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
170
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
400
Other Decks in Technology
See All in Technology
AWS基盤改善を支える 私たちの理念と行動指針
kentosuzuki
0
120
公共分野での生成AI活用
toru_kubota
1
300
Shared Signals Framework 仕様解説
oidfj
0
250
「AIチャットからもできないの?」と言われたら ~業務アプリをMCP対応するときの認証・認可の勘所
oidfj
0
190
BALLAS Technology Deck
ballas_inc
0
270
IoTとは〜? 数字で見るSORACOM UG【SORACOM UG Explorer 2026】
soracom
PRO
0
330
cdkd (CDK Direct)
gotok365
4
270
Metadata - Section 3 : Dublin Core Standard · DC
mohab1
0
120
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
740
コードレビューをなくして見えたもの
henteko
0
140
AI時代の組織作り:チーム開発から「個人×AI」への移行と、持続可能な「開発資本」の築き方
ham0215
2
330
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.2k
Featured
See All Featured
Practical Orchestrator
shlominoach
192
12k
Building AI with AI
inesmontani
PRO
1
1.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Claude Code のすすめ
schroneko
67
230k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
Done Done
chrislema
187
17k
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