On May 7, 2010, at 19:54 , Limestraël wrote:
> Personally I think fail is a terrible wart, and should be shunned.

So do I.
I can't understand its purpose since monads which can fail can be implemented through MonadPlus.


The translation of "do" syntax involves pattern matching ("do { [x,y,z] <- something; ... }"), and needs to know what to do when the pattern bind fails, so what it does is invoke "fail". This is arguably wrong but we're stuck with it now. (I have to admit I don't see why we can't do exactly what the obvious (>>= \[x,y,z] -> ...) translation does, which is throw an exception. "case", "let", and lambda binding don't invoke a special fail mechanism; why is "do" special?)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to