SLIDE 1
Monads for IO in Haskell
Program: echo :: IO () echo = do c ← getChar when (c = ‘∗’) $ do putChar c echo
2
Asymptotic Improvement of Computations over Free Monads Janis - - PowerPoint PPT Presentation
Asymptotic Improvement of Computations over Free Monads Janis Voigtl ander Technische Universit at Dresden MPC08 Monads for IO in Haskell Program: echo :: IO () echo = do c getChar when ( c = ) $ do putChar c echo
2
2
2
2
2
2
2
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
7
7
7
7
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
9
9
9
9
9
9
9
9
9
10