[Haskell-cafe] Are there arithmetic composition of functions?
Richard O'Keefe
ok at cs.otago.ac.nz
Tue Mar 20 03:05:41 CET 2012
On 20/03/2012, at 2:21 PM, Chris Smith wrote:
> On Mon, Mar 19, 2012 at 7:16 PM, Richard O'Keefe <ok at cs.otago.ac.nz> wrote:
>> One problem with hooking functions into the Haskell numeric
>> classes is right at the beginning:
>>
>> class (Eq a, Show a) => Num a
>
> This is true in base 4.4, but is no longer true in base 4.5.
I didn't say "GHC", I said "Haskell".
class (Eq a, Show a) => Num a where
(+), (-), (⋆) :: a -> a -> a
negate :: a -> a
abs, signum :: a -> a
fromInteger :: Integer -> a
-- Minimal complete definition:
-- All, except negate or (-)
x - y = x + negate y
negate x = 0 - x
comes straight from the Haskell 2010 report:
http://www.haskell.org/onlinereport/haskell2010/haskellch9.html#x16-1710009
There are other Haskell compilers than GHC.
More information about the Haskell-Cafe
mailing list