[m-dev.] Typeclasses and constructor classes.

David Glen JEFFERY dgj at cs.mu.OZ.AU
Fri Sep 22 11:02:26 AEDT 2000


On 21-Sep-2000, Michael Day <mcda at students.cs.mu.oz.au> wrote:
> 
> > I've replaced Jones' `|' with `given' and `->' with `>>'.  The
> > `given S >> T' in the typeclass declaration reads `given that
> > S uniquely determines T'.  Now our typing problems disappear:
> > empty/0 doesn't cause a problem by not mentioning T since T is
> > deducible from whatever S happens to be; map/2 also works out
> 
> Now that's getting quite exciting; is this the direction that type classes
> are likely to take in Mercury?

I think so, yes.

I haven't given much thought about how difficult the implementation is, though.
I imagine that the analysis part is `not too difficult', but I imagine that
being more lenient in the forms of instance declarations that we allow is
likely to have some significant repercussions on the rest of the system
(particularly on the runtime representations of typeclass infos, and on the
way in which we next type infos inside typeclass infos).


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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