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
フィジカル版Github Onshapeの紹介
shiba_8ro
0
290
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
2
660
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
240
Claude Codeをどのように キャッチアップしているか
oikon48
13
8.5k
脆弱性対応、どこで線を引くか
rymiyamoto
1
410
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
5
1.7k
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
220
人材育成分科会.pdf
_awache
4
300
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
220
アジャイルな経理と Claude Code と経営の未来
kawaguti
PRO
3
150
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
400
2026 TECHFRESH 畢業分享會 - 開發日常大解密!從領域驅動到企業級上線
line_developers_tw
PRO
0
1.3k
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
590
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
WCS-LA-2024
lcolladotor
0
640
Designing for humans not robots
tammielis
254
26k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
600
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
150
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
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