Proposal: Remove Show and Eq superclasses of Num
ekmett at gmail.com
Fri Sep 16 01:27:08 CEST 2011
+1 from me.
The primary concern is of course that this means loss of compatibility with the current Haskell Report.
foo :: Num a => a -> String
foo = show
would cease to type check.
Sent from my iPad
On Sep 15, 2011, at 6:58 PM, Ian Lynagh <igloo at earth.li> wrote:
> Hi all,
> I would like to propose that we remove the Show and Eq superclasses from
> Num, i.e. change
> class (Eq a, Show a) => Num a where
> class Num a where
> The first 2 attached patches (for base and ghc respectively) remove the
> Show constraint. I'm not aware of any justification for why this
> superclass makes sense.
> The next 2 patches (for base and unix respectively) remove the Eq
> constraint. Here's there's some justification in the superclass, as it
> f 5 = ...
> work for any Num type, rather than also needing an Eq constraint, but
> personally I would be in favour of removing this superclass too.
> Noteworthy is that Bits now needs an Eq superclass for the default
> methods for 'testBit' and 'popCount'.
> The fifth patch (for base) is what prompted me to get around to sending
> this proposal. It lets us de-orphan the Show Integer instance.
> Any opinions?
> Suggested discussion deadline: 12th October
> Libraries mailing list
> Libraries at haskell.org
More information about the Libraries