[Haskell-cafe] Prolog-style list syntax?

Anthony Clayden anthony.d.clayden at gmail.com
Wed Jun 30 07:00:45 UTC 2021

Ok thank you for the feedback, I get the message not to re-purpose
currently valid syntax.

For that reason, this won't fly:

I see no technical issues in allowing
> something like `[ x, y || ys]`

`||` is already an operator in the Prelude.

>    [x, y ,: ys ]           -- ? not currently valid

We could make list syntax work harder

>    [x, y ,:+ ys ]

Means desugar the commas by applying constructor `:+` instead of `:`. That
could be in general any constructor starting `:`.

Or indeed could be a pattern synonym starting `:`, which is a 'smart
constructor' to build the list maintaining some invariant.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210630/3c06b1fd/attachment.html>

More information about the Haskell-Cafe mailing list