[Haskell-cafe] Eq Type Class: Overloading (==)

John Meacham john at repetae.net
Sun Sep 18 20:28:22 EDT 2005


On Sat, Sep 17, 2005 at 12:36:06PM -0700, Jason Dagit wrote:
> 
> On Sep 17, 2005, at 1:43 AM, Bulat Ziganshin wrote:
> >
> >about making Bool a class - it is the same issue as making
> >head/map/... belonging to some Collection class. we need to change
> >standard Prelude or add to Haskell "supertyping" mechanism, proposed
> >by John Meacham, as i remember
> 
> A link to supertyping can be found here:
> http://repetae.net/john/recent/out/supertyping.html
> 
> After reading that, I wonder why it's not implemented.  It seems like  
> a wonderfully useful idea.  I view it as a way to add things back to  
> the language which should have been there to begin with, but which  
> the language designers left out for various reasons (such as lack of  
> time, interest or possibly even oversight).

I actually have some misgivings about the design I stated there and
would have some tweaks I would like to do before it was actually
implemented, but I definitly think we need more flexible ways to deal
with class hierachies (in some form).

my main concern is that

class Eq a => Ord a where
class Ord a <= Eq a where   

are not fully symmetric. the second lets you just declare things as Ord
without worrying about Eq, the first doesn't.

I think these issues can be worked out once a concrete implementation is
being worked on, which I hope to do for jhc.
        John


-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list