Any refutable pattern match in do would force MonadFail (or MonadPlus if you prefer). So
Hi John,You updated the proposal to say:
John Smith wrote:
Perhaps pattern match failures in a MonadPlus should bind to mzero - I
believe that this is what your example and similar wish to achieve.
a failed pattern match should error in the same way as is does for pure code, while in
MonadPlus, the current behaviour could be maintained with mzero
Can you be more specific as to how that would interact with polymorphism and type inference? What does it mean to be "in MonadPlus"? How does the compiler know?
For example, what would be the static types and dynamic semantics of the following expressions:
1. \a -> do {Just x <- return (Just a); return x}
2. do {Just x <- return Nothing; return x}
3. \a -> do {Just x <- a; return x}
4. \a b -> do {(x, _) <- return (a, b); return x}
5. \a -> do {(x, _) <- return a; return x}
Tillmann
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe