Unary operators [was: Re: ~ patterns]

Thomas Davie tatd2 at kent.ac.uk
Fri Feb 3 12:44:38 EST 2006


On Feb 3, 2006, at 9:34 AM, Bulat Ziganshin wrote:

> Hello Benjamin,
>
> Friday, February 03, 2006, 2:29:47 AM, you wrote:
>
> (+ x) --->> (? + x)
>
> i like this idea! but i tink that it's too late for such  
> incompatible change :(
>
> really, unary operators can be added to language without any troubles.
> we need only to prohibit using of the same symbol for unary and binary
> operators:
>
> unary 9 #
>
> #n = n-1
>
> f = #1-1
>
> we can even allow prefix and postfix operators as long as they all  
> have
> different names

The notable exception in this case, '-' (or anything starting with  
-), which breaks block comment syntax (see my earlier example).

Bob


More information about the Haskell-prime mailing list