[Haskell-beginners] annoying precedence of unary negate
Magnus Therning
magnus at therning.org
Mon Apr 28 04:24:47 UTC 2014
On Sun, Apr 27, 2014 at 10:59:27PM -0500, John M. Dlugosz wrote:
>
> [ ⋯ , translate (-50) 0 $ color green $ Circle 50 , ⋯]
>
> The parens around -50 are necessary.
> Is there a more elegant way to write it?
>
> Without the parens, I don't understand what the compiler sees it as, based
> on the error message. How does the compiler parse it in that case?
It most likely sees it as the binary minus rather than the unary minus.
/M
--
Magnus Therning OpenPGP: 0xAB4DFBA4
email: magnus at therning.org jabber: magnus at therning.org
twitter: magthe http://therning.org/magnus
The results point out the fragility of programmer expertise: advanced
programmers have strong expectations about what programs should look like,
and when those expectations are violated--in seemingly innocuous
ways--their performance drops drastically.
-- Elliot Soloway and Kate Ehrlich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140428/cdb85061/attachment.sig>
More information about the Beginners
mailing list