[m-dev.] for review: change typecheck.m to handle type class inference
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Mar 31 15:00:32 AEST 1998
On 31-Mar-1998, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> > + % if the argument types and the type
> > + % constraints are identical up to renaming,
> > + % then nothing has changed
> > + % (the call to same_length is just an
> > + % optimization -- catch the easy cases first)
> > + list__same_length(OldTypeConstraints,
> > + InferredTypeConstraints),
> > + same_structure(OldTypeConstraints,
> > + InferredTypeConstraints,
> > + ConstrainedTypes0, ConstrainedTypes),
> > + list__append(ConstrainedTypes0, ArgTypes0,
> > + TypesList0),
> > + list__append(ConstrainedTypes, ArgTypes,
> > + TypesList),
> > + identical_up_to_renaming(TypesList0, TypesList)
>
> Could you avoid these two appends by just calling identical_up_to_renaming
> twice?
No.
For example, :- pred p(T1, T2) is i.u.t.r. with :- pred p(T2, T1),
and c(T1, T2) is identical to c(T1, T2),
but :- pred p(T1, T2) <= c(T1, T2) is NOT i.u.t.r. with
:- pred p(T2, T1) <= c(T1, T2).
I'll add a comment.
> These should go in type_util.m, next to apply_subst_to_constraint and its
> cousins.
Shall do.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list