Mercurial > repo
changeset 1447:4ec67081254d
<GreyKnight> cat wisdom/monad_tutorials >> wisdom/monad-tutorials
author | HackBot |
---|---|
date | Sat, 12 Jan 2013 01:12:25 +0000 |
parents | 7b3d2f515be7 |
children | 5af50fe15fe0 |
files | wisdom/monad-tutorials |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/wisdom/monad-tutorials Sat Jan 12 01:12:07 2013 +0000 +++ b/wisdom/monad-tutorials Sat Jan 12 01:12:25 2013 +0000 @@ -7,3 +7,6 @@ Monads are like overloading the semicolon. class Monad m where ; (>>=) :: forall a b. m a -> (a -> m b) -> m b ; (>>) :: forall a b. m a -> m b -> m b ; return :: a -> m a ; fail :: String -> m a Actually, programming monads is much like cattle driving! +Monads can be used like adapters (the adapter pattern) in OOP. +A Monad is a class with a private field. +A monad is just a label that you stick onto a value to tell the compiler it's not a pure functional value.