[Haskell] Nested guards?

Simon Peyton-Jones simonpj at microsoft.com
Thu Dec 6 04:06:36 EST 2007


| Note that Clean also supports nested guards. See section 3.3 of the
| Clean language report:
|
| http://clean.cs.ru.nl/download/Clean20/doc/CleanRep2.0.pdf

Interesting, I didn't know that.

But (a) Clean guards don't bind, and pattern guards that bind was where this thread started.   And (b) the Clean manual says: "To ensure that at least one of the alternatives of a nested guard will be successful, a nested guarded alternative must always have a 'default case' as last alternative".  That's a pity.  The main point about guards is that failure means "go on to the next equation", a semantics that they could have chosen I guess.

Simon


More information about the Haskell mailing list