[m-rev.] for review: provide alternatives to can-fail functions in the library
Zoltan Somogyi
zoltan.somogyi at runbox.com
Sat Aug 10 05:42:51 AEST 2024
On Fri, 9 Aug 2024 11:44:35 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> > This diff also adds some "XXX STATEVAR"s to library/injection.m.
> > The marked predicates have non-statevar-friendly argument orders.
> > Given that injection.m is rarely used, I would like to simply change
> > those arguments orders in a follow-up diff, noting the change in NEWS.md.
> > Does anyone think that we need a more gradual implementation
> > of that change?
>
> No, you can go ahead and change them.
Will do.
> > Something that would definitely have more impact is replacing the semidet
> > function in the enum typeclass. (The uenum typeclass already has a
> > semidet *predicate* in the same role.) Since you cannot obsolete one
> > typeclass method in favor of another, I can't think of a way to make any
> > changeover any less disruptive than just making the replacement and announcing it,
> > and expecting everyone to fix their instance declarations when they next update
> > their Mercury standard library. Can anyone else?
>
> There are two sources of potential disruption:
>
> 1. Users who have implemented their own instances of the enum typeclass; as you
> say they will just need to update.
>
> 2. Users who have code that uses the from_int/1 method. For those, we can add
> the following to the enum module for the next release:
>
> :- pragma obsolete(func(from_int/1)).
> :- func from_int(int) = T is semidet <= enum(T).
>
> This can be deleted after the next release.
The attached diff does this. Since the concept has effectively been reviewed,
the diff is for post-commit review. What I am mainly seeking feedback on
is a new XXX in pred_table.m.
> The diff looks fine.
Thanks for the review.
Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.efi
Type: application/octet-stream
Size: 1287 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240809/385114c3/attachment.obj>
More information about the reviews
mailing list