[m-users.] Possiblt stupid list question....

Volker Wysk post at volker-wysk.de
Wed Dec 22 06:27:31 AEDT 2021


Am Dienstag, dem 21.12.2021 um 20:16 +0100 schrieb Volker Wysk:
> Am Dienstag, dem 21.12.2021 um 16:42 +0000 schrieb Sean Charles (emacstheviking):
> > Hi Zoltan,
> > I already had:
> > 
> > :- type rop
> >     --->    t(string)
> >     ;       tnl(string)
> >     ;       nl
> >     ;       tab(list(rop))
> >     ;       rops(list(rop)).
> > 
> > By adding a new type constructor, which I have done,
> > 
> >     ;       seq(string, list())
> 
> Those are called "data constructors", at least in Haskell. Since data is what's being constructed, not a type.

.... And something like "list" is a type constructor (again, speaking of Haskell, but it should be the same in Mercury). It takes a type (such as int) as an argument and constructs a type (such as list(int)).
Regards,
Volker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20211221/ddb172a9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20211221/ddb172a9/attachment.sig>


More information about the users mailing list