[Haskell-cafe] Prolog-style list syntax?

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Mon Jun 28 11:09:59 UTC 2021


> `[ x, y, z | zs ]` is also valid; [...]
> That structure is particularly ugly in Haskell syntax.

how so?  `x : y : z : zs`

Prolog list syntax is ugly here because
the "cons" operator (|) needs special parentheses.

Well, a similar thing in Haskell ist the ".."
(enumFromTo) operator.

For syntactic generality, you could go full Agda
https://agda.readthedocs.io/en/v2.6.0.1/language/mixfix-operators.html
but I'm not sure whether brackets could be "name parts"

- J.W.


More information about the Haskell-Cafe mailing list