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
29
SCA-07 Art and Entertainment
kanaya
0
93
PLT-A3 Maybe Monad
kanaya
0
43
PLT-A2 Closure
kanaya
0
49
PLT-A1 Programming Principles
kanaya
0
34
PLT-X1 Division by Zero and Maybe
kanaya
1
78
IUM-03-Short Series of Functions
kanaya
0
150
PLT-02 How to Count Words
kanaya
0
110
IMU-00 Pi
kanaya
0
420
Other Decks in Education
See All in Education
P3NFEST 2026 Spring ハンズオン「ハッキング・ラブ!はじめてのハッキングをやってみよう」資料
nomizone
0
340
計算物理におけるGitの使い方 / 01-c-compphys
kaityo256
PRO
2
500
タイムマシンのつくりかた
nomizone
3
1.2k
JAPAN AI CUP Prediction Tutorial
upura
2
910
Tips for the Presentation - Lecture 2 - Advanced Topics in Big Data (4023256FNR)
signer
PRO
0
500
Gitの仕組みと用語 / 01-b-term
kaityo256
PRO
0
210
Avoin jakaminen ja Creative Commons -lisenssit
matleenalaakso
0
2.1k
インシデント対応
akira345
0
300
GOBUSATA紹介
chankawa919
0
130
160人の中高生にAI・技術体験の講師をしてみた話
shuntatoda
1
410
0121
cbtlibrary
0
150
2025年の本当に大事なAI動向まとめ
frievea
1
200
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
30 Presentation Tips
portentint
PRO
1
260
Everyday Curiosity
cassininazir
0
170
Code Reviewing Like a Champion
maltzj
528
40k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Building Applications with DynamoDB
mza
96
7k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
Fireside Chat
paigeccino
42
3.8k
GitHub's CSS Performance
jonrohan
1032
470k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
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 ผղ