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
440
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
継続的なAIコスト最適化
bgpat
1
290
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
560
今こそ知りたいAmplifyGen2
mkdev10
2
160
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
160
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
4
1.2k
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
自分で立ててみるLLMサービス
y_sera15
0
160
Cognition AI Japan - ウェビナー2_テストQA_運用監視
cogakira
0
140
Deep Data Security 機能解説
oracle4engineer
PRO
2
790
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
140
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
300
パッチ更新でterraform initが落ちた日
grimoh
1
120
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
GraphQLとの向き合い方2022年版
quramy
50
15k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Navigating Weather and Climate Data
rabernat
0
550
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Building an army of robots
kneath
307
47k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
460
Ethics towards AI in product and experience design
skipperchong
2
420
Believing is Seeing
oripsolob
1
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.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