Mercurial > hg > Papers > 2015 > atton-thesis
comparison src/exec_list_monad.txt @ 22:fc44782929a7
Add monad in Haskell
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 Feb 2015 11:17:00 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
21:7d94faaeb448 | 22:fc44782929a7 |
---|---|
1 *Main> let x = Cons 100 (Cons 200 (Cons 400 Nil)) | |
2 *Main> let f = \x -> Cons (x+1) (Cons (x+10) (Cons (x*x) Nil)) | |
3 *Main> x >>= f | |
4 Cons 101 (Cons 110 (Cons 10000 (Cons 201 (Cons 210 (Cons 40000 (Cons 401 (Cons 410 (Cons 160000 Nil)))))))) |