Numerical type system problem
Originally, in haskell 98 the factorial function
f 0 = 1
f n = n * f (n - 1)
has type Num a => a -> a, while after ghc 7.4 it requires Eq type class. I suggest that Num type class should be redefined as
class Eq a => Num a where
...
Since all the numbers are equality checkable. we can be more aggressive to have Order super class for numbers even complex numbers are not well ordered. I suppose that this is like the historical problem like Applicative should be the super class of Monad.
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.3 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | ekmett, hvr |
Operating system | |
Architecture |