<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 28 Jun 2021 at 23:20, Johannes Waldmann <<a href="mailto:johannes.waldmann@htwk-leipzig.de">johannes.waldmann@htwk-leipzig.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> `[ x, y, z | zs ]` is also valid; [...]<br>
> That structure is particularly ugly in Haskell syntax.<br>
<br>
how so?  `x : y : z : zs`<br>
<br></blockquote><div><br></div><div>Because almost always you need to put parens round -- certainly in a pattern match.</div><div><br></div><div>And it's not square brackets, which would say 'here comes a list'.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Prolog list syntax is ugly here because<br>
the "cons" operator (|) needs special parentheses.<br></blockquote><div><br></div><div>Exactly! Special list-heralding brackets.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Well, a similar thing in Haskell ist the ".."<br>
(enumFromTo) operator.<br>
<br></blockquote><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">@Jeff <span style="color:rgb(0,0,0);font-family:monospace,monospace;font-size:1em;white-space:pre-wrap">But I actually like this the best:<br></span>    [x, y, z, zs...] = list<br></blockquote><div><br></div><div>Or maybe </div><div><br></div><div>>   [x, y, z, zs@..] = list</div><div><br></div><div>Could be an as-pattern binding to the tail. But now it's getting heavyweight.<br></div><div><br></div><div> </div></div></div>