diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-05-23 12:31:32 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-05-23 12:31:32 +0200 |
commit | b1b445697db31b1603a31747ca31151f97ee7263 (patch) | |
tree | 453bbe1e16e2abd0b605e7807a33de4eaba4a866 /packages/base/src/Numeric/Matrix.hs | |
parent | 36379e29fe99b033313f42464897c32b9805559d (diff) |
join SContainer and Container using Fractional contexts
Diffstat (limited to 'packages/base/src/Numeric/Matrix.hs')
-rw-r--r-- | packages/base/src/Numeric/Matrix.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/base/src/Numeric/Matrix.hs b/packages/base/src/Numeric/Matrix.hs index a9022c6..5f27652 100644 --- a/packages/base/src/Numeric/Matrix.hs +++ b/packages/base/src/Numeric/Matrix.hs | |||
@@ -37,7 +37,7 @@ import Numeric.Chain | |||
37 | instance Container Matrix a => Eq (Matrix a) where | 37 | instance Container Matrix a => Eq (Matrix a) where |
38 | (==) = equal | 38 | (==) = equal |
39 | 39 | ||
40 | instance (Container Matrix a, Num (Vector a)) => Num (Matrix a) where | 40 | instance (Container Matrix a, Num a, Num (Vector a)) => Num (Matrix a) where |
41 | (+) = liftMatrix2Auto (+) | 41 | (+) = liftMatrix2Auto (+) |
42 | (-) = liftMatrix2Auto (-) | 42 | (-) = liftMatrix2Auto (-) |
43 | negate = liftMatrix negate | 43 | negate = liftMatrix negate |
@@ -48,7 +48,7 @@ instance (Container Matrix a, Num (Vector a)) => Num (Matrix a) where | |||
48 | 48 | ||
49 | --------------------------------------------------- | 49 | --------------------------------------------------- |
50 | 50 | ||
51 | instance (Container Vector a, Fractional (Vector a), Num (Matrix a)) => Fractional (Matrix a) where | 51 | instance (Container Vector a, Fractional a, Fractional (Vector a), Num (Matrix a)) => Fractional (Matrix a) where |
52 | fromRational n = (1><1) [fromRational n] | 52 | fromRational n = (1><1) [fromRational n] |
53 | (/) = liftMatrix2Auto (/) | 53 | (/) = liftMatrix2Auto (/) |
54 | 54 | ||