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

Andrea Rossato mailing_list at istitutocolli.org
Wed Aug 30 05:02:39 EDT 2006


Il Tue, Aug 29, 2006 at 10:02:38AM +0100, Brian Hulley ebbe a scrivere:
Hi!
Ím getting back so late because it took me a while to understand
monadic transformation...

> data Result a
>    = Good a State Output
>    | Bad State Output
>    deriving Show
> 
...
>        case runSOIE m x of
>            Good a y o1 ->
>                case runSOIE (f a) y of
>                    Good b z o2 -> Good b z (o1 ++ o2)
>                    Bad z o2 -> Bad z (o1 ++ o2)
>            Bad z o2 -> Bad z o2  -- (*)

This is brilliant and highly instructive (for me at least)!!
Thank you very much.
Regards,
Andrea


More information about the Haskell-Cafe mailing list