]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Piecewise.hs
Fix a few warnings.
[numerical-analysis.git] / src / Piecewise.hs
index e550e4bf54659f434e88ea5ea369e5c61e3ada90..6d2f5085e31b88fe85468cc31e70e853c8fc1f3f 100644 (file)
@@ -11,7 +11,6 @@ where
 import qualified Algebra.Additive as Additive ( C )
 import qualified Algebra.Field as Field ( C )
 import Control.Arrow ( first )
-import Data.Maybe ( catMaybes )
 import Misc ( partition )
 import NumericPrelude
 import qualified Prelude as P
@@ -42,8 +41,8 @@ data Piecewise a =
 --   point and the result is returned wrapped in a 'Just'. If the
 --   point is outside of the domain, 'Nothing' is returned.
 evaluate :: Piecewise a -> a -> Maybe a
-evaluate (Piecewise pieces) x =
-  foldl f Nothing pieces
+evaluate (Piecewise ps) x =
+  foldl f Nothing ps
   where
     f (Just y) _ = Just y
     f Nothing (p,g) = if p x then Just (g x) else Nothing