[mercury-users] Typeclasses & parameters

Jörg Roman Rudnick joerg.rudnick at t-online.de
Mon May 28 21:07:44 AEST 2007

Hi Tomas,

oops,  I was in a hurry...

at `1)', I intended to write `(possibly *empty*)'...,

at `4)', I should have written:

4) You declare a typeclass

:-typeclass tree(T, V, E) <= ( iVertex(V), iEdge(E) ) where [...].

Now you can create a convenient parametrised type upon `xVertex' & 
`xEdge', e.g. a `btree(V, E)'. Thanks to existential types, it may be 
used in an instance by

:-type xBtree == btree(xVertex, xEdge).

:-instance tree(xBtree, xVertex, xEdge) where [...].

All the best,

mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list