[Haskell-cafe] map (-2) [1..5]

Jared Updike jupdike at gmail.com
Thu Aug 17 16:17:51 EDT 2006


> I'd also argue that in maths the necessary brackets are implied by the
> superscripting syntax

ASCII text parsing issues aside, in math,

    2
-4           =    ?

(No you cannot ask if there is space between the 4 and the - symbol,
or if I "meant" (-4)^2   or -(4^2), or if I wrote a negative sign or a
subtract sign. I believe there is only one standard interpretation
here.)

> they can only get in through the "back door" of evaluation
> which just doesn't seem right.

Constant folding can eliminate any runtime cost, so effectively 0 - 2
==> negative 2 at compile time. No problem.

  Jared

-- 
http://www.updike.org/~jared/
reverse ")-:"


More information about the Haskell-Cafe mailing list