Alex,

would it be a solution if you defined

> data RetVal b a = Result a | Exception b 

in this case you could say

> instance Monad (RetVal b) where
>   return = Result
>   Result x >>= f = f x
>   Exception x >>= f = Exception x

Hope that helps

-Peter


Reply via email to