prefix minus and infix resolution

Christian Maeder Christian.Maeder at dfki.de
Wed Jul 14 08:22:48 EDT 2010


Atze Dijkstra schrieb:
> Hi,
> 
> I prefer the simplicity of http://hackage.haskell.org/trac/haskell-prime/wiki/NegationBindsTightly over the more involved proposal.

It's a simple design choice but hard to put into practice for
compatibility reasons.

It is an old design choice between fortran and C style (earlier taken
for Haskell) http://www.obliquity.com/computer/fortran/operate.html

> I'd gladly pay the price of adding some parenthesis to force "- x ^ 2" to "- (x ^ 2)".

fortran and python have infix power operators that bind more tightly
than unary minus. The mathematical unusual silent interpretation of "- x
^ 2" as "(- x) ^ 2" is the problem (and not that I better should write
"- (x ^ 2)").

Other languages i.e. C do not have a power operator!
Does "- pow x 2" read better? Leave it to users to define "^" and "**"
as they like?

Cheers Christian

 This is also much more clearer, less dependent on context info (i.e.
the fixity of other operators), thus understandable without inspecting
the definition of ^ in some other module, and thus also easier to
explain (to students), and thus lessening the steepness of Haskells
learning curve somewhat.
> 
> cheers,
> 
> On  13 Jul, 2010, at 18:38 , Christian Maeder wrote:
> 
>> Hi,
>>
>> I'm asking for support of:
>>
>> http://hackage.haskell.org/trac/haskell-prime/wiki/PrefixMinusResolution
>>
>> Cheers Christian
>>
>> Simon Marlow schrieb:
>>> BTW, here's a related proposal made by Simon PJ earlier this year:
>>>
>>> http://hackage.haskell.org/trac/haskell-prime/wiki/NegationBindsTightly
>>>
>>> please consider merging the proposals, or at least clearly identifying
>>> the differences, if any.
>> _______________________________________________
>> Haskell-prime mailing list
>> Haskell-prime at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-prime
> 
> 
>                 - Atze -
> 
> Atze Dijkstra, Department of Information and Computing Sciences. /|\
> Utrecht University, PO Box 80089, 3508 TB Utrecht, Netherlands. / | \
> Tel.: +31-30-2534118/1454 | WWW  : http://www.cs.uu.nl/~atze . /--|  \
> Fax : +31-30-2513971 .... | Email: atze at cs.uu.nl ............ /   |___\
> 
> 
> 


More information about the Haskell-prime mailing list