Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functors
Search
Sebastian Bruckner
June 21, 2017
Programming
0
26
Functors
Sebastian Bruckner
June 21, 2017
Tweet
Share
Other Decks in Programming
See All in Programming
[SF Ruby Feb'26] The Silicon Heel
palkan
0
120
20260315 AWSなんもわからん🥲
chiilog
2
170
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
410
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
2.8k
Ruby and LLM Ecosystem 2nd
koic
1
1.2k
『Kubernetes ☸️ で実践する Platform Engineering 』を最高速度で読み抜いたる!!👊🏻
hiroki_hasegawa
0
100
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.6k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
280
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
170
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
3k
Codex の「自走力」を高める
yorifuji
0
1.3k
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
200
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
190
WCS-LA-2024
lcolladotor
0
490
For a Future-Friendly Web
brad_frost
183
10k
RailsConf 2023
tenderlove
30
1.4k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
310
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
490
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Transcript
Functors
Monoids
trait Monoid[A] { def empty: A def combine(one: A, another:
A): A }
Addition: empty: 0 combine: a + b Multiplication: empty: 1
combine: a * b List: empty: Nil combine: a ++ b
associativity: (x |+| y) |+| z = x |+| (y
|+| z) left identity: Monoid[A].empty |+| x = x right identity: x |+| Monoid[A].empty = x
Functors
// Option Some(2).map(_ * 3) === Some(6) None.map(_ * 3)
=== None
// List List(1, 2).map(_ * 3) === List(3, 6)
❓
Functors
trait Functor[F[_]] { def map[A, B](fa: F[A])(f: A => B):
F[B] }
identity: (x map identity) === x composition: (x map (v
=> g(f(v))) === (x map f map g)
Functors
-> -> ->