| Subject: | Re: [Haskell-cafe] IO (Either a Error) question |
|---|---|
| From: | Ross Paterson |
| Date: | Sat, 8 May 2010 01:15:11 +0100 |
On Sat, May 08, 2010 at 01:54:21AM +0200, 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.
It was introduced to implement pattern match failure in do-notation,
in Section 3.14 of the Haskell Report:
do {p <- e; stmts} = let ok p = do {stmts}
ok _ = fail "..."
in e >>= ok
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe
|
| Previous by Date: | Re: [Haskell-cafe] Re: Haskell and scripting, Brandon S. Allbery KF8NH |
|---|---|
| Next by Date: | Re: [Haskell-cafe] IO (Either a Error) question, Brandon S. Allbery KF8NH |
| Previous by Thread: | Re: [Haskell-cafe] IO (Either a Error) question, Gregory Crosswhite |
| Next by Thread: | Re: [Haskell-cafe] IO (Either a Error) question, Brandon S. Allbery KF8NH |
| Indexes: | [Date] [Thread] [Top] [All Lists] |