From: Michael Orlitzky Date: Mon, 7 Apr 2014 16:09:23 +0000 (-0400) Subject: Fix a few warnings. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9b639d75334420747ce83376910af90368940640;p=numerical-analysis.git Fix a few warnings. --- diff --git a/src/Linear/Matrix.hs b/src/Linear/Matrix.hs index 8006bde..f6dbec0 100644 --- a/src/Linear/Matrix.hs +++ b/src/Linear/Matrix.hs @@ -109,8 +109,8 @@ instance (Eq a) => Eq (Mat m n a) where -- >>> m1 == m3 -- False -- - (Mat rows1) == (Mat rows2) = - V.and $ V.zipWith comp rows1 rows2 + (Mat rows_one) == (Mat rows_two) = + V.and $ V.zipWith comp rows_one rows_two where -- Compare a row, one column at a time. comp row1 row2 = V.and (V.zipWith (==) row1 row2) @@ -557,11 +557,11 @@ infixl 7 * instance (Ring.C a, Arity m, Arity n) => Additive.C (Mat m n a) where - (Mat rows1) + (Mat rows2) = - Mat $ V.zipWith (V.zipWith (+)) rows1 rows2 + (Mat rows_one) + (Mat rows_two) = + Mat $ V.zipWith (V.zipWith (+)) rows_one rows_two - (Mat rows1) - (Mat rows2) = - Mat $ V.zipWith (V.zipWith (-)) rows1 rows2 + (Mat rows_one) - (Mat rows_two) = + Mat $ V.zipWith (V.zipWith (-)) rows_one rows_two zero = Mat (V.replicate $ V.replicate (fromInteger 0)) diff --git a/src/Piecewise.hs b/src/Piecewise.hs index e550e4b..6d2f508 100644 --- a/src/Piecewise.hs +++ b/src/Piecewise.hs @@ -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