X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FRealFunction.hs;h=834c27a7c0a7fa5b811daeaaa6de1caf5ca62664;hb=01925d099b231a128f6bd51abd61bf9ff9c424b6;hp=5e0832d24d515ea750c7452ee0f2e336d07d4f5b;hpb=89b8b6e94fcc944a1f4611811265f3c6217af850;p=spline3.git diff --git a/src/RealFunction.hs b/src/RealFunction.hs index 5e0832d..834c27a 100644 --- a/src/RealFunction.hs +++ b/src/RealFunction.hs @@ -13,13 +13,13 @@ instance Eq (RealFunction a) where _ == _ = 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