[m-dev.] Typeclasses and constructor classes.

Michael Day mcda at students.cs.mu.oz.au
Thu Sep 21 16:50:26 AEDT 2000


> :- typeclass sequence(S(T)) where [
> 	func empty = S(T),
> 	func cons(T, S(T)) = S(T),
> 	func head(S(T)) = T,
> 	func tail(S(T)) = S(T),
> 	...
> ].
> 
> and
> 
> :- instance sequence(list(T)).

Hmm, can I say

:- instance sequence(string, char).

or some equivalent?

Michael


--------------------------------------------------------------------------
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