[Haskell-beginners] annoying precedence of unary negate
Kim-Ee Yeoh
ky3 at atamo.com
Mon Apr 28 05:13:58 UTC 2014
On Mon, Apr 28, 2014 at 10:59 AM, John M. Dlugosz
<ngnr63q02 at sneakemail.com>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?
Without the parens, minus would be parsed just like plus.
What would 'translate +50 0 blah' parse into?
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140428/d560f426/attachment.html>
More information about the Beginners
mailing list