[Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread John Smith
Monads seem to use fail in one of three ways: -Regular monads leave it at the default definition of error -MonadPlus sometimes redefines it to mzero -IO redefines it to failIO Are there any other definitions of fail? If not, does the special case of IO really need a class-level definition, or

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd love for the compiler to give an error (or maybe just a warning) in the case that I have a pattern match in a monad that just blows up (throws an exception) on a pattern match failure. Currently there's no way to know the behavior of failed pattern match failures without looking at the

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Lauri Alanko
On Tue, Dec 21, 2010 at 08:31:08AM -0700, Jonathan Geddes wrote: I'd love for the compiler to give an error (or maybe just a warning) in the case that I have a pattern match in a monad that just blows up (throws an exception) on a pattern match failure. You will be interested to know that

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Johannes Waldmann
everything you ask for already was in Haskell ages ago: those were the days ... where the method in Functor method was called map, and zero was a method of, guess what, MonadZero... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd be really interested in learning the rationale behind those changes. I'm sure it wasn't done for capricious or arbitrary reasons, but I can't help but see it as a step back. --Jonathan Geddes (sent from android mobile) On Dec 21, 2010 8:47 AM, Lauri Alanko l...@iki.fi wrote: On Tue, Dec 21,