[m-dev.] for review: tuples [1]
Ralph Becket
rbeck at microsoft.com
Wed Aug 2 00:53:07 AEST 2000
> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
>
> From a language design stand-point, one disadvantage of tuples
> is that it is difficult to write type class instance declarations
> for them, because they are unbounded in arity, and there is no
> way to write a single instance declaration which works for all
> tuple types.
Hang on, surely {T1}, {T2, T2}, {T1, T2, T3} are all distinct
types, each with a very definite arity?
Without thinking too deeply about it, making a tuple type an instance
of a typeclass would be an odd thing to do, but I don't see why it
should be hard to handle. Caveat: my impression is that the whole
tuple thing is somewhat like having a pre-defined infinite set of
types {T1}, {T1, T2}, ... with constructors {}/1, {}/2, ... built
into the language.
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