[Haskell-cafe] Prolog-style list syntax?

Jeff Clites jclites at mac.com
Mon Jun 28 18:04:46 UTC 2021


On Jun 28, 2021, at 4:09 AM, Johannes Waldmann <johannes.waldmann at htwk-leipzig.de> wrote:

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

I don’t mind the existing either, but it would be interesting if this worked:

    [x, y, z] ++ zs = list

But really, it redefines (++), so it has a different meaning already.

But you could imagine some special syntax “outside” the brackets, instead of inside.

Jeff


More information about the Haskell-Cafe mailing list