[m-dev.] for review: tuples [1]

Simon Taylor stayl at cs.mu.OZ.AU
Sun Aug 6 13:50:59 AEST 2000


> On 01-Aug-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> > > 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?
> 
> Yes.  It's easy enough to write an instance definition for any one
> of them.  But when you're writing an instance definition for one
> of them, most often you will want to write an instance definition for
> all of them.  And there's no way to write a finite set of instance
> declarations that covers them all.

Given that tuples are going to be used mostly for overcoming
limitations in interfaces (for passing multiple arguments where
only one is allowed), I think that not being able to write
instance declarations which work for all tuple types is not
a big problem.

Simon.
--------------------------------------------------------------------------
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