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
140
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
370
Other Decks in Technology
See All in Technology
Hardware/Software Co-design: Motivations and reflections with respect to security
bcantrill
1
210
GitHub Copilot CLI 現状確認会議
torumakabe
10
3.2k
20260120 Amazon VPC のパブリックサブネットを無くしたい!
masaruogura
2
140
Kusakabe_面白いダッシュボードの表現方法
ykka
0
350
迷わない!AI×MCP連携のリファレンスアーキテクチャ完全ガイド
cdataj
0
630
歴史から学ぶ、Goのメモリ管理基礎
logica0419
14
2.9k
形式手法特論:コンパイラの「正しさ」は証明できるか? #burikaigi / BuriKaigi 2026
ytaka23
17
6.4k
ソフトとハード両方いけるデータ人材の育て方
waiwai2111
1
530
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
AWS監視を「もっと楽する」ために
uechishingo
0
190
Models vs Bounded Contexts for Domain Modularizati...
ewolff
0
210
[Iceberg Meetup #4] ゼロからはじめる: Apache Icebergとはなにか? / Apache Iceberg for Beginners
databricksjapan
0
260
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
51
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
71
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
45
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
730
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
120
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
46
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