From: Michael Orlitzky Date: Thu, 28 Apr 2011 01:29:05 +0000 (-0400) Subject: Clean up some RealFunction definitions (remove lambdas). X-Git-Tag: 0.0.1~364 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=569d6f0f57afccafa5bb4c39e23fcf5e6a77bc03;p=spline3.git Clean up some RealFunction definitions (remove lambdas). --- 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