[m-rev.] for review: expand the class of allowed coercions

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Jul 31 06:35:27 AEST 2026


For review by Peter.

I am in two minds about whether the small database built up
by this diff, mapping type_ctors to the set of their invariant type
parameters, should be added to the typecheck_info structure, or not.

On the one hand, adding it to the typecheck_info can prevent
redundant computations, which can be non-trivial if we ever get
coercions between types whose definitions are large. (This can
happen after this diff.)

On the other hand, expanding typecheck_(sub_)_info imposes a
cost on all compiler invocations, even the ones that do not involve
any coercions.

I am leaning towards leaving things as they are, with a note to
revisit the issue if and when coerces of large types become
more commonplace.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.ktc
Type: application/octet-stream
Size: 2213 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20260730/80ff7858/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.ktc
Type: application/octet-stream
Size: 18483 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20260730/80ff7858/attachment-0003.obj>


More information about the reviews mailing list