[m-rev.] Fast string library
Ralph Becket
rbeck at microsoft.com
Wed May 16 20:35:54 AEST 2001
> From: Peter Schachte [mailto:schachte at cs.mu.OZ.AU]
> Sent: 16 May 2001 01:50
>
> I don't think type classes are quite right for this, since comparison
is
> available for all types. I think we need Mercury to support a "where
> comparison is" clause on type definitions. Or perhaps this idea
should be
> generalized to the concept of a user-defined type class that has a
default
> implementation of all methods. The default definitions can be used to
make
> every type an honorary member of the type class; an instance
declaration
> would only be needed where an alternative to the default
implementation for
> some methods is wanted.
"where comparison is" would be a good one and, presumably, it could
subsume "where equality is".
To make the typeclass-only idea work, we would presumably have to make
every
user defined type an instance and automatically provide default
implementations. Moreover, we would have to restrict the declaration of
instancehood for this case to the defining module. Bleugh.
"where comparison is" gets my vote.
- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list