[m-rev.] for review: typecheck error message simplification
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Jul 24 11:40:35 AEST 2001
On 23-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > + (
> > + { TypeStuffList = [ExampleTypeStuff | _] },
> > + { list__all_same(TypeStuffList) }
> > + ->
> > + { ExampleTypeStuff = type_stuff(VType, TVarSet, TBinding) },
> > io__write_string(" has type `"),
> > write_type_b(VType, TVarSet, TBinding),
> > io__write_string("'")
>
> I don't think that is safe -- I think you need to apply the type bindings
> before doing the test for the values being the same. Otherwise you might
> get some false hits.
Granted I don't know *exactly* what the semantics of the type_stuff constructor
are, but I don't see how that code can be unsafe. If two elements of
TypeStuffList are the same, then the code in both the then and the else
branches will output the same for both elements, because neither takes any
input *except* the list elements.
It is possible that list__all_same is too conservative: some elements that are
different before substitution may become identical after substitution. However,
the code above should be a step in the right direction.
Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list