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
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
27
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
TeXで変える教育現場
doratex
1
16k
学習指導要領と解説に基づく学習内容の構造化の試み / Course of study Commentary LOD JAET 2025
masao
1
140
Chapitre_2_-_Partie_3.pdf
bernhardsvt
0
170
悩める リーダー達に 届けたい書籍|レジリエントマネジメント 書籍イントロダクション-260126
mimoza60
1
370
Adobe Express
matleenalaakso
2
8.2k
計算物理におけるGitの使い方 / 01-c-compphys
kaityo256
PRO
1
180
栃木県警サイバーセキュリティ研修会2026
nomizone
0
300
1202
cbtlibrary
0
220
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Chapitre_2_-_Partie_2.pdf
bernhardsvt
2
190
自己紹介 / who-am-i
yasulab
6
6.4k
Web Search and SEO - Lecture 10 - Web Technologies (1019888BNR)
signer
PRO
2
3.1k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Producing Creativity
orderedlist
PRO
348
40k
Technical Leadership for Architectural Decision Making
baasie
2
270
The agentic SEO stack - context over prompts
schlessera
0
670
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
The SEO Collaboration Effect
kristinabergwall1
0
380
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
59
50k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
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 ผղ