Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PLT-14 IO Monad
Search
kanaya
July 28, 2025
Education
0
22
PLT-14 IO Monad
kanaya
July 28, 2025
Tweet
Share
More Decks by kanaya
See All by kanaya
PLT-A4 IO Monad
kanaya
0
15
SCA-07 Art and Entertainment
kanaya
0
84
PLT-A3 Maybe Monad
kanaya
0
32
PLT-A2 Closure
kanaya
0
31
PLT-A1 Programming Principles
kanaya
0
26
PLT-X1 Division by Zero and Maybe
kanaya
1
63
IUM-03-Short Series of Functions
kanaya
0
140
PLT-02 How to Count Words
kanaya
0
89
IMU-00 Pi
kanaya
0
400
Other Decks in Education
See All in Education
Microsoft Office 365
matleenalaakso
0
2k
コマンドラインを見直そう(1995年からタイムリープ)
sapi_kawahara
0
540
俺と地方勉強会 - KomeKaigi・地方勉強会への期待 -
pharaohkj
1
1.5k
20250910_エンジニアの成長は自覚するところから_サポーターズ勉強会
ippei0923
0
350
附属科学技術高等学校の概要|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
2.8k
仏教の源流からの奈良県中南和_奈良まほろば館‗飛鳥・藤原DAO/asuka-fujiwara_Saraswati
tkimura12
0
160
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
2
3.1k
アジャイルの知見から新卒研修作り、そして組織作り
pokotyamu
0
110
相互コミュニケーションの難しさ
masakiokuda
0
310
Requirements Analysis and Prototyping - Lecture 3 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
1008
cbtlibrary
0
110
外国籍エンジニアの挑戦・新卒半年後、気づきと成長の物語
hypebeans
0
630
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Designing Experiences People Love
moore
143
24k
What's in a price? How to price your products and services
michaelherold
246
12k
Being A Developer After 40
akosma
91
590k
Balancing Empowerment & Direction
lara
5
790
Building Flexible Design Systems
yeseniaperezcruz
330
39k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Git: the NoSQL Database
bkeepers
PRO
432
66k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Site-Speed That Sticks
csswizardry
13
990
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Transcript
pineapple.cc ۚ୩Ұ࿕ʢ࡚େֶใσʔλՊֶ෦ʣ *0Ϟφυ ϓϩάϥϛϯάݴޠ
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
pineapple.cc
pineapple.cc
pineapple.cc
pineapple.cc
pineapple.cc
pineapple.cc
pineapple.cc x :: String x = “Hello, world!” main =
print x
pineapple.cc x :: IO String x = getLine main =
x >>= print
pineapple.cc x :: IO String x = getLine f ::
String -> String f x = if length x > 3 then “Too long.” else x main = (f x) >>= print
pineapple.cc x :: IO String x = getLine f ::
String -> IO String f x = if length x > 3 then return “Too long.” else return x main = (f x) >>= print
pineapple.cc x :: IO String x = getLine f ::
IO String -> IO String f x = x >>= (\x’ -> if length x’ > 3 then return “Too long.” else return x’) main = (f x) >>= print
pineapple.cc x :: IO String x = getLine f ::
String -> String f x = if length x > 3 then “Too long.” else x f’ :: IO String -> IO String f’ = liftM f main = (f' x) >>= print ผղ
pineapple.cc x :: IO String x = getLine f ::
String -> String f x = if length x > 3 then “Too long.” else x f’ :: IO String -> IO String f’ = liftM f main = (return x) >>= f’ >>= print ผղ
pineapple.cc x :: IO String x = getLine f ::
String -> String f x = if length x > 3 then “Too long.” else x main = x >>= (\x’ -> return (f x’)) >>= print ผղ