Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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.3k
Native Extensions Served 3 Ways
gja
0
390
Other Decks in Technology
See All in Technology
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
490
AI de Idea
kawaguti
PRO
2
130
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.5k
SREは、MCPとAutopilotをこう使え!
kazumax55
3
940
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
700
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
300
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.8k
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
180
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
120
The Knowledge Spine: A Machine-Executable Ontology for Governed Marketing Activation
vananth22
0
120
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
10
4.9k
AIは推し活である。
kurazuuuuuu
1
940
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
880
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
How to make the Groovebox
asonas
2
2.4k
Unsuck your backbone
ammeep
672
58k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
540
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Paper Plane
katiecoart
PRO
4
53k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
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