[Haskell-cafe] Is my code too complicated?

Stephen Tetley stephen.tetley at gmail.com
Mon Jul 5 05:57:57 EDT 2010

On 5 July 2010 10:39, Yves Parès <limestrael at gmail.com> wrote:

> 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

More information about the Haskell-Cafe mailing list