
On 2008 Sep 14, at 10:01, Stephan Friedrichs wrote:
Johannes Waldmann wrote:
I think the crux of the matter was that a monad is too general. Either there is a result or there is not. That's precisely the intended use of a Maybe.
Indeed "Monad m =>" is dangerous here because not every Monad has a reasonable definition of "fail".
But that seems to be a problem in the (current) definition of "Monad", and its solution was "MonadZero", no?
I agree that the MonadZero class with a useful 'zero' :: m a would be the right abstraction for views. But MonadZero is not part of base, mtl or any other common package, or am I missing something? Changing this is beyond a simple heap package ;)
MonadZero is what "fail" replaced in Haskell98. Many people consider this a serious mistake. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH