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-14 IO Monad
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kanaya
July 28, 2025
Education
0
34
PLT-14 IO Monad
kanaya
July 28, 2025
Tweet
Share
More Decks by kanaya
See All by kanaya
PLT-A4 IO Monad
kanaya
0
28
SCA-07 Art and Entertainment
kanaya
0
92
PLT-A3 Maybe Monad
kanaya
0
40
PLT-A2 Closure
kanaya
0
46
PLT-A1 Programming Principles
kanaya
0
32
PLT-X1 Division by Zero and Maybe
kanaya
1
73
IUM-03-Short Series of Functions
kanaya
0
150
PLT-02 How to Count Words
kanaya
0
100
IMU-00 Pi
kanaya
0
410
Other Decks in Education
See All in Education
Adobe Express
matleenalaakso
2
8.2k
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
タイムマシンのつくりかた
nomizone
1
990
計算物理におけるGitの使い方 / 01-c-compphys
kaityo256
PRO
1
190
心理学を学び活用することで偉大なスクラムマスターを目指す − 大学とコミュニティを組み合わせた学びの循環 / Becoming a great Scrum Master by learning and using psychology
psj59129
1
1.9k
【dip】「なりたい自分」に近づくための、「自分と向き合う」小さな振り返り
dip_tech
PRO
0
250
Data Representation - Lecture 3 - Information Visualisation (4019538FNR)
signer
PRO
1
2.8k
AIで日本はどう進化する? 〜キミが生きる2035年の地図〜
behomazn
0
120
【洋書和訳:さよならを待つふたりのために】第2章 ガン特典と実存的フリースロー
yaginumatti
0
240
Human Perception and Colour Theory - Lecture 2 - Information Visualisation (4019538FNR)
signer
PRO
0
3k
資格支援制度-株式会社HIT
kabushikigaisya_hit
0
300
核軍備撤廃に向けた次の大きな一歩─核兵器を先には使わないと核保有国が約束すること
hide2kano
0
270
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
63
53k
Unsuck your backbone
ammeep
671
58k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
250
How GitHub (no longer) Works
holman
316
140k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
Claude Code のすすめ
schroneko
67
220k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Skip the Path - Find Your Career Trail
mkilby
0
71
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
190
Between Models and Reality
mayunak
1
210
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
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 ผղ