[m-dev.] string streams
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Nov 20 10:48:56 AEDT 2000
On 19-Nov-2000, Michael Day <mikeday at corplink.com.au> wrote:
> So... what is the recommended way of approaching specialisations like
> this, where particular_container(T) can be implemented easily in terms of
> generalised_container(T), but for particular instances of T people wish to
> use different implementations?
Use C++? ;-)
One possibility is to use multi-parameter type classes. Define a
`container(Container, ElementType)' type class, and define instances
for `container(particular_container, particular_type)' and
`container(generalised_container(T), T)'. Unfortunately the latter
falls foul of our current restrictions on instance declarations.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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