
Conor McBride wrote:
Claus Reinke wrote:
...the results of the translation are rather more awkward but -and this is the important point- pattern guards do not add new functionality.
Well, neither do Boolean guards nor even basic pattern matching... one simply should not need to clutter a program with do, return, mplus and fromJust (ugh!), spelling out the semantics of pattern matching in minute detail. For at least 36 years, we've been able to hide all that junk behind a highly readable equational notation. This is one monad we don't need to see.
Some complex things are happening: selections and bindings are happening at the same time. The monad spells it out clearly and concisely, without adding very much weight at all. Function definitions appear visually almost the same, with or without the pattern guards. There has to be a really, really compelling reason to add new syntax to a language. Every bit of new syntax makes a language harder to learn, and less usable for the general user.
without pattern guards, we're forced to the right if we want to examine the result of an intermediate computation. This means we have to do any subsequent analysis using the syntax of expressions which is much clunkier than that of left-hand sides.
Nice point. -Yitz