[m-users.] Usage of inst subtypes with list.foldl in rotd
Dirk Ziegemeyer
dirk at ziegemeyer.de
Mon Mar 2 06:29:47 AEDT 2015
Dear,
during migrating my app from mercury version 14.01.1 to rotd-2015-02-20, I discovered that I can’t use list.foldl any more with inst subtypes.
Julien noticed already that some parts of the mode checker have been tightened up and that this would require some modifications in my code.
As a workaround I use foldl with a slightly different mode declaration:
Instead of:
:- mode foldl(pred(in, in, out) is det, in, in, out) is det.
This mode declaration solved the issue:
:- mode foldl(pred(in(I0), in(I1), out(I1)) is det,
in(list(I0)), in(I1), out(I1)) is det.
Is there a way, I could use list.foldl from the standard library again?
There are two small test cases attached to this email. One of them only works with version 14.01.1 and the other works both with 14.01.1 and rotd-2015-02-20.
Best regards,
Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foldSubtypes.m
Type: application/octet-stream
Size: 1094 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20150301/b6cff304/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foldSubtypesForRotd.m
Type: application/octet-stream
Size: 1420 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20150301/b6cff304/attachment-0001.obj>
More information about the users
mailing list