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
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
380
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
580
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
480
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
20
3.6k
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
320
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
800
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
110
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.4k
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
950
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
童醫院敏捷轉型的實踐經驗
cclai999
0
190
Featured
See All Featured
Bash Introduction
62gerente
614
210k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Designing Experiences People Love
moore
142
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Faster Mobile Websites
deanohume
307
31k
How to Ace a Technical Interview
jacobian
277
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
We Have a Design System, Now What?
morganepeng
53
7.7k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
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
-> -> ->