[m-dev.] Typeclasses and constructor classes.

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Sep 20 23:31:14 AEDT 2000


On 20-Sep-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
> Another situation where you want explicit annotations
> is when you're using an abstract typeclass:
> 
> 	:- interface.
> 	:- typeclass foo(T).
> 
> 	:- implementation.
> 
> 	:- typeclass foo(T) where [...].
> 	...
> 
> Here the interface does not give any clue as to the kind of `T'.
> To make the interface self-contained, in such situations we should
> require an explicit kind annotation.

Jolly good point.

However, rather than require an explicit annotation I think we should assume
kind `t' unless declared otherwise (to make the common case simpler).


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