[Haskell-cafe] Inverting a Monad

Lutz Donnerhacke lutz at iks-jena.de
Wed Feb 6 07:49:30 EST 2008


* Felipe Lessa wrote:
> Prelude Control.Monad> inv []
> [()]
> Prelude Control.Monad> inv [10]
> [()]

 inv m = if m == mzero then return () else mzero `asTypeOf` m

Yes, unfair.


More information about the Haskell-Cafe mailing list