[Haskell-beginners] (:

Ezequiel Hernan Di Giorgi hernan.digiorgi at gmail.com
Fri Dec 7 01:06:31 CET 2012


this code compiles correcly:

newtype State s a = State { runState :: *s* -> (a,s) }

instance Monad (State s) where
  --return :: a -> State s a
    return x = State (\st -> (*x,st*))

but this one doesn't compile:

newtype State s a = State { runState :: *a* -> (a,s) }

instance Monad (State s) where
  --return :: a -> State s a
    return x = State (\st -> (*st,x*))

Why is this happening?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121206/9208a7ae/attachment.htm>


More information about the Beginners mailing list