[Haskell-beginners] annoying precedence of unary negate

Kim-Ee Yeoh ky3 at atamo.com
Mon Apr 28 07:08:24 UTC 2014

On Mon, Apr 28, 2014 at 10:59 AM, John M. Dlugosz
<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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140428/54ccfac0/attachment-0001.html>

More information about the Beginners mailing list