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
PLT-A3 Maybe Monad
Search
kanaya
July 26, 2025
Education
0
25
PLT-A3 Maybe Monad
kanaya
July 26, 2025
Tweet
Share
More Decks by kanaya
See All by kanaya
PLT-A4 IO Monad
kanaya
0
12
PLT-14 IO Monad
kanaya
0
20
SCA-07 Art and Entertainment
kanaya
0
80
PLT-A2 Closure
kanaya
0
24
PLT-A1 Programming Principles
kanaya
0
23
PLT-X1 Division by Zero and Maybe
kanaya
1
45
IUM-03-Short Series of Functions
kanaya
0
120
PLT-02 How to Count Words
kanaya
0
77
IMU-00 Pi
kanaya
0
390
Other Decks in Education
See All in Education
日本の情報系社会人院生のリアル -JAIST 修士編-
yurikomium
1
110
2025/06/05_読み漁り学習
nag8
0
190
【品女100周年企画】Pitch Deck
shinagawajoshigakuin_100th
0
5.6k
人になにかを教えるときに考えていること(2025-05版 / VRC-LT #18)
sksat
5
1.1k
Education-JAWS #3 ~教育現場に、AWSのチカラを~
masakiokuda
0
220
2025年度春学期 統計学 第12回 分布の平均を推測する ー 区間推定 (2025. 6. 26)
akiraasano
PRO
0
150
~キャラ付け考えていますか?~ AI時代だからこそ技術者に求められるセルフブランディングのすゝめ
masakiokuda
7
420
Pythonパッケージ管理 [uv] 完全入門
mickey_kubo
23
23k
2026 g0v 零時政府年會啟動提案 / g0v Summit 2026 Kickstart
rschiang
0
210
Pydantic(AI)とJSONの詳細解説
mickey_kubo
0
180
Alumnote inc. Company Deck
yukinumata
0
1.8k
生成AIとの上手な付き合い方【公開版】/ How to Get Along Well with Generative AI (Public Version)
handlename
0
610
Featured
See All Featured
Navigating Team Friction
lara
189
15k
Statistics for Hackers
jakevdp
799
220k
Done Done
chrislema
185
16k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
The Invisible Side of Design
smashingmag
301
51k
Agile that works and the tools we love
rasmusluckow
330
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Cult of Friendly URLs
andyhume
79
6.6k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
A designer walks into a library…
pauljervisheath
207
24k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
185
54k
Transcript
pineapple.cc ۚ୩Ұ࿕ʢ࡚େֶใσʔλՊֶ෦ʣ ʲิʳ.BZCFϞφυ ϓϩάϥϛϯάݴޠ
pineapple.cc Value Func Value’ x′  = fx
pineapple.cc Value Func Value’ Func3 Func2 Func1 • • x′
 = (h ∙ g ∙ f)x
pineapple.cc Value Func Value’ x′  = fx Float
pineapple.cc 1 0 = ?
None
pineapple.cc θϩআࢉͷରԠ w ϓϩάϥϜΛҟৗऴྃͤ͞Δʢྫ֎Λൃੜͤ͞Δʣ w ༗ཧશମɼ࣮શମΑΓʮ͍ʯू߹Λ͏ w *O fi OJUZͱ͍͏ʹ͢Δ
w /B/ /PUB/VNCFS ͱ͍͏ʹ͢Δ w ൚༻తͳΈΛ͏
pineapple.cc 1 0 = ?
pineapple.cc fx ≡ 1/x
pineapple.cc f :: Float -> Float f x = 1.0/x
pineapple.cc fx ≡ { 1/x if x ≠ 0 ∅
otherwise
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise
pineapple.cc f :: Float -> Float f x = 1/x
f :: Float -> Maybe Float f x = if x /= 0 then Just (1/x) else Nothing
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise
pineapple.cc fx ≡ { [1/x] if x ≠ 0 []
otherwise
pineapple.cc f :: Float -> Maybe Float f x =
if x /= 0 then Just (1/x) else Nothing f :: Float -> [Float] f x = if x /= 0 then [1/x] else []
pineapple.cc Value Func Value’ x′  = fx Maybe Float
Float
pineapple.cc Value Func’ Value’ x′  = f′  x
Maybe Float Maybe Float
pineapple.cc f′  x ≡ { ⟨1/x⟩ if x ≠
∅ and x ≠ 0 ∅ otherwise
pineapple.cc Value Func Value’ Func3 Func2 Func1 • • x′
 = (h ∙ g ∙ f)x
pineapple.cc Value Func’ Value’ Func3 Func2 Func1 • • x′
 = (h ∘ g ∘ f)x
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise gx ≡ 2.0 × x
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise gx ≡ 2.0 × x g′  x ≡ ⟨gx⟩
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise gx ≡ 2.0 × x g′  x ≡ ⟨gx⟩ x′  ≡ (g′  ∘ f)x
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ 0 ∅
otherwise gx ≡ 2.0 × x g′  x ≡ ⟨gx⟩ x′  ≡ ⟨x⟩ ↣ f ↣ g′ 
pineapple.cc f :: Float -> Maybe Float f x =
if x /= 0 then Just (1/x) else Nothing g :: Float -> Float g x = 2.0*x g’ :: Float -> Maybe Float g’ x = Just (g x) x’ = Just 2 >>= f >>= g’
pineapple.cc f :: Float -> Maybe Float f x =
if x /= 0 then Just (1/x) else Nothing g :: Float -> Float g x = 2.0*x x’ = (liftM g . f) x ผղ
pineapple.cc fx ≡ { ⟨1/x⟩ if x ≠ ∅ and
x ≠ 0 ∅ otherwise gx ≡ 2.0 × x x′  ≡ (g* ∙ f)x ผղ