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
Lightning - Monads you already use (without kno...
Search
Tejas Dinkar
July 19, 2014
Technology
1
410
Lightning - Monads you already use (without knowing it)
The lightning talk version of this talk.
Tejas Dinkar
July 19, 2014
Tweet
Share
More Decks by Tejas Dinkar
See All by Tejas Dinkar
Quick Wins for Page Speed
gja
0
150
Progressive Web Apps In Clojure(Script)
gja
4
2.5k
Monads you've already put in production (without knowing it)
gja
1
1.2k
Native Extensions Served 3 Ways
gja
0
380
Other Decks in Technology
See All in Technology
ドキュメントからはじめる未来のソフトウェア
pkshadeck
4
2.1k
Amazon Bedrock AgentCore EvaluationsでAIエージェントを評価してみよう!
yuu551
0
190
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
1
130
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
1
260
GCASアップデート(202510-202601)
techniczna
0
210
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
72k
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
630
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
430
Databricks Free Edition講座 データサイエンス編
taka_aki
0
250
セキュリティ はじめの一歩
nikinusu
0
1.2k
Vitest Highlights in Angular
rainerhahnekamp
0
120
新規事業 toitta におけるAI 機能評価の話 / AI Feature Evaluation in toitta
pokutuna
0
290
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
160
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
200
Paper Plane
katiecoart
PRO
0
46k
Testing 201, or: Great Expectations
jmmastey
46
8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
For a Future-Friendly Web
brad_frost
182
10k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
Leo the Paperboy
mayatellez
4
1.4k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Transcript
Monads you’ve already put in prod Tejas Dinkar Nilenso Software
about.me • Hi, I’m Tejas • Nilenso: Partner • twitter:
tdinkar • github: gja
If you think you understand Monads, you don't understand Monads.
This talk is inaccurate and will make a mathematician cry
Monads • Programmable Semicolons • Used to hide plumbing away
from you • Monads are just monoids in the category of endofunctors
None
Values Value
Monads Value Box
Monads • Monads define two functions • return takes a
value and puts it in a box • bind takes a box & function, and returns a box with f(value)
Some math (√4) + 5
Some math (√4) + 5 3 or 7!
Value 4
Monad [4]
return def m_return(x) [x] end # m_r(4) => [4]
Square Root fn def sqrt(x) s = Math.sqrt(x) [s, -s]
end # sqrt(4) => [2, -2]
Bind Function x = m_return(4) y = ?????(x) { |p|
sqrt(p) } # I want [-2, 2]
Bind Function x = m_return(4) y = x.flat_map {|p| sqrt(p)
} # y => [2, -2]
Increment Fn def inc_5(x) [x + 5] end # inc_5(1)
=> [6]
Putting it together m_return(4). flat_map {|p| sqrt(p)}. flat_map {|p| inc_5(p)}
# => [3, 7]
You have invented the List Monad, used to model non-determinism
Congrats