Pattern guards

Yitzchak Gale gale at sefer.org
Sun Oct 1 07:40:18 EDT 2006


On 9/28/06, I wrote:
> I would like to suggest a correction to ticket #56,
> "Pattern Guards".

Here is a summary of the discussion:

There seems to be a consensus that the main
"Pro" currently listed in the ticket is not the real
reason.

Pros:

- Many people have been accustomed to using
this syntax for a long time.

- Some people find pattern guards to be elegant
and aesthetically pleasing.

- The alternative monadic style requires knowledge
of monads.

- More selections are pushed to the lefthand-side of
bindings.

- Already implemented in most compilers, appears
to be easy to implement.

Cons:

- The semantics of "<-" are further overloaded in a
potentially confusing way.

- At least one person does not find pattern guards to be
elegant and aesthetically pleasing at all. :)

- Some people feel that the net gain, if any, is not worth the
cost of changing the syntax of the core of Haskell.
(Others do not see it as so much of a change, since it
has been available in practice for a long time.)

Anything else?

-Yitz


More information about the Haskell-prime mailing list