@@ -137,21 +137,20 @@ instance (Ord a, Ord b) => Ord (a, b) where
137137 then compare xl yl
138138 else compare xr yr
139139
140−
141140-- --------------------------------------------------------- [ Negatable Class ]
142141||| The Negatable class defines a typeclass for which negation works.
143142||| This is used for implementing unary -
144−class Negatable a where
143+class Neg a where
145144 negate : a -> a
146145
147−instance Negatable Integer where
148− negate x = (-1) * x
146+instance Neg Integer where
147+ negate x = prim__subBigInt 0 x
149148
150−instance Negatable Int where
151− negate x = (-1) * x
149+instance Neg Int where
150+ negate x = prim__subInt 0 x
152151
153−instance Negatable Float where
154− negate x = (-1.) * x
152+instance Neg Float where
153+ negate x = prim__negFloat x
155154
156155-- --------------------------------------------------------- [ Numerical Class ]
157156||| The Num class defines basic numerical arithmetic.