[Haskell-cafe] state and exception or types again...

Andrea Rossato mailing_list at istitutocolli.org
Mon Aug 28 17:38:57 EDT 2006

Il Mon, Aug 28, 2006 at 09:28:02PM +0100, Brian Hulley ebbe a scrivere:
> data Eval_SOI a = SOIE {runSOIE :: State -> (a, State, Output, Bool)}

seems simple and neat...

>            else r1
> ie if runSOIE m x does not result in an exception then we continue with the 
> second computation otherwise we just return the exception (r1) immediately.

well, I thought that this was not possible:
(>>=) :: m a -> (a -> m b) -> m b

This is why I think that two constructors are needed, but with two
constructors is not possible...;-)

I'm trying to dig into this problem also to see if it has to do with
monad laws. But probably this is just a late night guess.

Thanks for your kind attention.
Best regards,

More information about the Haskell-Cafe mailing list