[Haskell-beginners] annoying precedence of unary negate

John M. Dlugosz ngnr63q02 at sneakemail.com
Mon Apr 28 09:13:29 UTC 2014


On 4/28/2014 2:08 AM, Kim-Ee Yeoh wrote:
>
> On Mon, Apr 28, 2014 at 10:59 AM, John M. Dlugosz <ngnr63q02 at sneakemail.com
> <mailto:ngnr63q02 at sneakemail.com>> wrote:
>
>     Also, is the comma in a list different from the operator comma which is noted as
>     right-associative precedence 5?  I had thought that the item separator in the list was
>     special syntax that had very low precedence.
>
>
> The _colon_ is a non-rebindable special-syntax operator with infixr 5.
>
> Otoh, the _comma_ in a list is _not_ an operator but merely an item separator.
>
> Comma-separated list notation e.g. [1,2,3] is special syntax that desugars to e.g. 1:2:3:[].
>
> Other than that, the colon and comma don't have anything else in common.
>
> -- Kim-Ee
>
>

I misread the chart:  the “:,++” meant to use the comma to separate two operators, not be 
one of three operators listed.





More information about the Beginners mailing list