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
430
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Lightning - Monads you already use (without knowing it)
The lightning talk version of this talk.
Tejas Dinkar
July 19, 2014
More Decks by Tejas Dinkar
See All by Tejas Dinkar
Quick Wins for Page Speed
gja
0
160
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
390
Other Decks in Technology
See All in Technology
しぶいSRE: サーバから見えない障害にどう向き合うか。ラストワンマイルのデバッグ実践 / Shibui SRE
kanny
13
6.1k
Claude Code公式skillで 自分の仕事を少しずつ手放そう!(Claude Code開発ノウハウ大公開スペシャル by クラスメソッド)
kaym
1
300
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
180
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
2
620
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
280
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
120
Claude Codeとハーネスについて考えてみる
oikon48
18
9.4k
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
150
KiCAD講習会②
tutcreators
0
110
AI時代の EM への処方箋
staka121
PRO
0
140
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
490
Zoom2Youtube.Claude
kawaguti
PRO
3
490
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
340
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
Become a Pro
speakerdeck
PRO
31
6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Rails Girls Zürich Keynote
gr2m
96
14k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
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