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.4k
Monads you've already put in production (without knowing it)
gja
1
1.2k
Native Extensions Served 3 Ways
gja
0
360
Other Decks in Technology
See All in Technology
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
230
モダンデータスタックの理想と現実の間で~1.3億人Vポイントデータ基盤の現在地とこれから~
taromatsui_cccmkhd
2
270
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
720
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
250
Claude Skillsの テスト業務での活用事例
moritamasami
1
110
AWS運用を効率化する!AWS Organizationsを軸にした一元管理の実践/nikkei-tech-talk-202512
nikkei_engineer_recruiting
0
180
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.7k
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.3k
Bedrock AgentCore Memoryの新機能 (Episode) を試してみた / try Bedrock AgentCore Memory Episodic functionarity
hoshi7_n
2
1.9k
さくらのクラウド開発ふりかえり2025
kazeburo
2
1.2k
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
490
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
94
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
How to build a perfect <img>
jonoalderson
0
4.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Google's AI Overviews - The New Search
badams
0
870
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
860
Abbi's Birthday
coloredviolet
0
3.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Paper Plane
katiecoart
PRO
0
44k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
31
Building Applications with DynamoDB
mza
96
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