$30 off During Our Annual Pro Sale. View Details »
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
140
Progressive Web Apps In Clojure(Script)
gja
4
2.4k
Monads you've already put in production (without knowing it)
gja
1
1.2k
Native Extensions Served 3 Ways
gja
0
360
Other Decks in Technology
See All in Technology
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
200
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
890
20251222_サンフランシスコサバイバル術
ponponmikankan
2
140
Building Serverless AI Memory with Mastra × AWS
vvatanabe
0
500
2025年のデザインシステムとAI 活用を振り返る
leveragestech
0
170
Amazon Quick Suite で始める手軽な AI エージェント
shimy
1
1.8k
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
230
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
490
Microsoft Agent Frameworkの可観測性
tomokusaba
1
110
Identity Management for Agentic AI 解説
fujie
0
460
「もしもデータ基盤開発で『強くてニューゲーム』ができたなら今の僕はどんなデータ基盤を作っただろう」
aeonpeople
0
240
AI駆動開発の実践とその未来
eltociear
1
490
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.2k
How to Ace a Technical Interview
jacobian
281
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
75
Believing is Seeing
oripsolob
0
15
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Exploring anti-patterns in Rails
aemeredith
2
200
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
57
37k
Amusing Abliteration
ianozsvald
0
69
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
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