[Haskell-cafe] Inverting a Monad

Bas van Dijk v.dijk.bas at gmail.com
Wed Feb 6 08:07:27 EST 2008

On Feb 6, 2008 1:49 PM, Lutz Donnerhacke <lutz at iks-jena.de> wrote:
>  inv m = if m == mzero then return () else mzero `asTypeOf` m


> :t inv
inv :: (MonadPlus m, Eq (m ())) => m () -> m ()

The 'Eq' constraint on 'm ()' is a bit problemetic I think in case 'm'
is a function like a 'State'.



More information about the Haskell-Cafe mailing list