[mercury-users] typeclass constraint on type definition... wrong

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 28 16:19:53 AEST 1999


On 28-May-1999, Richard A. O'Keefe <ok at atlas.otago.ac.nz> wrote:
> The constraint that k belong to the Ord type class is not
> an "accidental" property of some of the *functions*, it's
> a fundamental property of the priority queue *type*.

I agree with Richard on this one.

Our original design for type classes in Mercury was deliberately
conservative.  This particular feature of Haskell had been
debated quite a bit in the Haskell community, and there had
been suggestions by some of the prominent Haskell researchers
that this feature ought to be dropped in Haskell 98.
Given our aim of starting off with a fairly conservative design,
I think leaving out type class constraints on data type definitions
was the right decision at the time.

However, I think Richard is right and the Haskell people who suggested
dropping the feature in Haskell 98 were wrong.  Therefore I think it
would be a good idea to support type class constraints on data type
declarations in a future version of Mercury.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list