[m-dev.] type class constraints
David Glen JEFFERY
dgj at cs.mu.OZ.AU
Tue Dec 21 11:59:00 AEDT 1999
On 20-Dec-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 15-Dec-1999, Michael Day <mcda at cat.cs.mu.OZ.AU> wrote:
> > :- pred snort(T, T) <= is_funky(T, char).
> >
> > This will be flagged as an error by the compiler, stating that such
> > constraints are not implemented. Will they be implemented and if so, when?
> > The lack of them appears to make multiple parameter type classes less
> > useful than they would otherwise be.
>
> I don't quite recall our rationale for not supporting that.
> DJ, do you remember? What would happen if we were to just
> uncomment that check?
I'm pretty sure that either the RTTI that gets generated would be wrong or the
compiler would barf when generating the RTTI.
When we originally made the restriction I suspect that we have single parameter
type classes in mind; if there is only a single parameter, then (given our
restrictions on the form of instance declarations) there is no loss of
expressiveness. Michael's example is reasonably compelling, though...
dgj
--
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student, | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.| With sufficient formality
The University of Melbourne | The sheerist banality
Australia | Will be hailed by the critics: "Miraculous!"
| -- Anon.
--------------------------------------------------------------------------
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