Jeff,
The problem here is that when you match on "f x", your first match is an identifier that matches anything at all, and binds it to mzero. I think what you're looking for is
can :: (MonadPlus m) => (a -> m b) -> a -> Bool
can f x = case f x of
mzero -> False
_ -> True
I got a warning:
__testError.hs:31:11:
Warning: Pattern match(es) are overlapped
In a case alternative: _ -> ...
Ok, modules loaded: Main.
x' | x' == mzero -> False
can f x = case f x of
_ -> True
Jeff
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe