[m-dev.] io streams

Ralph Becket rbeck at microsoft.com
Tue Jan 4 20:55:25 AEDT 2000


> From: Peter Schachte [mailto:schachte at cs.mu.OZ.AU]
> 
> The amount of inconvenience of this approach will be directly
> proportional to the number of default methods one would like and
> inversely proportional to the number of non-default methods.  If there
> are 10 default methods and 100 non-default ones, this doesn't look too
> bad.  If there are 10 default methods and 1 non-default, it looks
> terrible.

I don't agree: read_chars is something that I may very well want to
override in an implementation.  I don't really have a problem with
explicitly hooking up to default methods as that's often very helpful 
when debugging or reading code.

> I suspect I'd tend to want a lot of default methods, as they would
> allow both simplicity and flexibility in instance definitions, but
> until I use type classes a bit, I don't really know.

I think you've hit the nail on the head here.  I can see lists becoming
instances of a generalised sequence typeclass and most of the list module
being ripped out into a module dealing with sequences in general.  The
question is which operations are properly part of the typeclass and which
are more generally useful?

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