
5 Jul
2010
5 Jul
'10
5:57 a.m.
On 5 July 2010 10:39, Yves Parès
Then what is your alternative? How do you replace monad transformers?
Possibly more a case of doing without rather than replacing them with something else, you would amalgamate all the monadic effects you want into one monad. E.g. State and Environment (reader) and partiality (Maybe) newtype Amalgamated s e a = Amalgamated { getAmalgamated :: e -> s -> (Maybe a,st) } instance Monad (Amalgamated s e) where return a = Amalgamated $ \e s -> return (Just a, st) m >>= k = Amalgamated $ \e s -- TODO (after the first coffee of the morning...)