On Feb 6, 2008 11:32 AM, Bas van Dijk <[EMAIL PROTECTED]> wrote: > The following obviously doesn't work: > > inv m = (m >> mzero) `mplus` return () > > because it will always return ().
How about:
inv m = do
success <- (m >> return True) `mplus` return False
if success then mzero else return ()
Luke
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
