[Haskell-cafe] Prolog-style list syntax?
hecate at glitchbra.in
Mon Jun 28 11:31:02 UTC 2021
Having learned Erlang before Haskell, I recall having the opposite
opinion at first. ;)
Le 28/06/2021 à 13:26, MigMit a écrit :
> I did some work with Erlang, which uses Prolog-style syntax. I've always found this [H|T] to be confusing, since T is not an element of that list. But it could be because I've learned Haskell before Erlang.
>> On 28 Jun 2021, at 13:09, 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`
>> 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
>> but I'm not sure whether brackets could be "name parts"
>> - J.W.
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> Only members subscribed via the mailman list are allowed to post.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
More information about the Haskell-Cafe