[m-dev.] Re: [HAL-dev] Polymorphism and solver type initialisation
Ralph Becket
rafe at cs.mu.OZ.AU
Wed Jul 7 13:37:00 AEST 2004
I've just had a word with Zoltan about implementing the solver type
class mechanism.
The way type classes are currently handled in the compiler is rather
snarly and complicated and unfortunately somewhat divorced from the rest
of type analysis.
Zoltan's advice is to stick with the current scheme (where the
initialisation predicate must be statically deciable by the compiler and
where we don't fully handle polymorphic solver type code) until we redo
the Mercury compiler's type and type class analyses, probably using
the approach described in Peter, Maria and Bart's paper "Type Constraint
Solving for Parametric and Ad-hoc Polymorphism".
Any complaints?
-- Ralph
Ralph Becket, Wednesday, 7 July 2004:
> My current solver types implementation does not handle polymorphic code:
> when a call is being scheduled during mode analysis, a call to the
> appropriate solver type initialisation predicate is inserted for any
> call arguments that have inst `free', but which the call expects to have
> inst `any'. It is currently a mode error if the compiler cannot
> statically determine the right initialisation predicate, hence
> polymorphic solver type code does not work at present.
>
> The proposed solution is to have the initialisation predicate as a
> method of a solver type class, a la HAL, to which all solver types will
> belong.
>
> Anybody see a problem with that?
>
> -- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list