Re: Proposal: Syntax extension

From: Sebastian Fischer <>
Date: Fri, 28 Jan 2011 23:26:15 +0900

I wrote:

Patterns are rigid or flexible and have fall-through or non-deterministic
> semantics in presence of overlapping rules. The current situation mixes
> these aspects.

I realize that these aspects are not as independent as I thought.
Fall-through pattern matching called on a free variable would always pick
the first rule which seems of questionable utility.

I support overlapping case expressions with non-deterministic semantics but
would like to avoid the name 'fcase' in favor of 'cases'. So

    coin = cases () of _ -> 0; _ -> 1

would be a possible implementation of (0?1).

I thought about a generalization of the proposal for undeclared free
variables. In addition to allowing anonymous free variables written as _ one
could treat every identifier that starts with an underscore and is not in
scope as if it was a free variable implicitly declared using a where clause.
For example

    half n | n =:= add _m _m = _m

would be a valid definition. However, currently identifiers are not allowed
to start with an underscore. Why not? I guess the reason must be
Curry-specific (Haskell allows such identifiers).


curry mailing list
Received on Fr Jan 28 2011 - 16:57:01 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:11 CEST