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
20
PLT-14 IO Monad
kanaya
July 28, 2025
Tweet
Share
More Decks by kanaya
See All by kanaya
PLT-A4 IO Monad
kanaya
0
12
SCA-07 Art and Entertainment
kanaya
0
80
PLT-A3 Maybe Monad
kanaya
0
25
PLT-A2 Closure
kanaya
0
24
PLT-A1 Programming Principles
kanaya
0
23
PLT-X1 Division by Zero and Maybe
kanaya
1
44
IUM-03-Short Series of Functions
kanaya
0
120
PLT-02 How to Count Words
kanaya
0
76
IMU-00 Pi
kanaya
0
390
Other Decks in Education
See All in Education
Education-JAWS #3 ~教育現場に、AWSのチカラを~
masakiokuda
0
220
AIの時代こそ、考える知的学習術
yum3
2
190
大学院進学について(2025年度版)
imash
0
110
H5P-työkalut
matleenalaakso
4
39k
20250625_なんでもCopilot 一年の振り返り
ponponmikankan
0
340
みんなのコード 2024年度活動報告書/ 2025年度活動計画書
codeforeveryone
0
240
2025/06/05_読み漁り学習
nag8
0
190
日本の教育の未来 を考える テクノロジーは教育をどのように変えるのか
kzkmaeda
1
230
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
1.8k
人になにかを教えるときに考えていること(2025-05版 / VRC-LT #18)
sksat
4
1.1k
質のよいアウトプットをできるようになるために~「読む・聞く、まとめる、言葉にする」を読んで~
amarelo_n24
0
200
マネジメント「される側」 こそ覚悟を決めろ
nao_randd
10
5.5k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
695
190k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Building Applications with DynamoDB
mza
96
6.6k
A better future with KSS
kneath
239
17k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Rails Girls Zürich Keynote
gr2m
95
14k
Six Lessons from altMBA
skipperchong
28
4k
Building an army of robots
kneath
306
46k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Typedesign – Prime Four
hannesfritz
42
2.8k
Side Projects
sachag
455
43k
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 ผղ