_ == _ = False
instance Num (RealFunction a) where
- f1 + f2 = \x -> (f1 x) + (f2 x)
- f1 - f2 = \x -> (f1 x) - (f2 x)
- f1 * f2 = \x -> (f1 x) * (f2 x)
- negate f = \x -> -1 * (f x)
- abs f = \x -> abs (f x)
- signum f = \x -> signum (f x)
- fromInteger i = \_ -> (fromInteger i)
+ (f1 + f2) x = (f1 x) + (f2 x)
+ (f1 - f2) x = (f1 x) - (f2 x)
+ (f1 * f2) x = (f1 x) * (f2 x)
+ (negate f) x = -1 * (f x)
+ (abs f) x = abs (f x)
+ (signum f) x = signum (f x)
+ fromInteger i _ = fromInteger i
-- Takes a constant, and a function as arguments. Returns a new