Matt's Haskell Learnings
Friday, December 9, 2011
Monad examples
http://www.haskell.org/haskellwiki/Simple_monad_examples
Just
5
>>=
(
\ x
->
if
(
x
==
0
)
then
fail
"zero"
else
Just
(
x
+
1
)
)
http://hackage.haskell.org/packages/archive/base/4.4.1.0/doc/html/Data-Maybe.html#t:Maybe
data Maybe a = Nothing | Just a
instance Monad Maybe
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment