Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What

Name: Anonymous 2009-11-21 14:34

what the fuck is a monad

Name: Anonymous 2009-11-21 15:26

>>1
It's any data type m of kind * -> * that possesses implemetations for these functions:
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b


that abide by these rules:

m >>= return   ≡ m
return a >>= f ≡ f a
m >>= f >>= g  ≡ m >>= (\a -> f a >>= g)


which basically say that return and >>= don't make any undue changes to the monad.

Newer Posts