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/LinearAlgebra/Static | |
parent | 36379e29fe99b033313f42464897c32b9805559d (diff) |
join SContainer and Container using Fractional contexts
Diffstat (limited to 'packages/base/src/Numeric/LinearAlgebra/Static')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs b/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs index a5fc29b..7ecb132 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs | |||
@@ -322,12 +322,12 @@ instance forall n t . (Num (Vector t), Numeric t )=> Num (Dim n (Vector t)) | |||
322 | negate = lift1F negate | 322 | negate = lift1F negate |
323 | fromInteger x = Dim (fromInteger x) | 323 | fromInteger x = Dim (fromInteger x) |
324 | 324 | ||
325 | instance (Num (Vector t), Num (Matrix t), Numeric t) => Fractional (Dim n (Vector t)) | 325 | instance (Num (Vector t), Num (Matrix t), Fractional t, Numeric t) => Fractional (Dim n (Vector t)) |
326 | where | 326 | where |
327 | fromRational x = Dim (fromRational x) | 327 | fromRational x = Dim (fromRational x) |
328 | (/) = lift2F (/) | 328 | (/) = lift2F (/) |
329 | 329 | ||
330 | instance (Floating (Vector t), Numeric t) => Floating (Dim n (Vector t)) where | 330 | instance (Fractional t, Floating (Vector t), Numeric t) => Floating (Dim n (Vector t)) where |
331 | sin = lift1F sin | 331 | sin = lift1F sin |
332 | cos = lift1F cos | 332 | cos = lift1F cos |
333 | tan = lift1F tan | 333 | tan = lift1F tan |
@@ -357,12 +357,12 @@ instance (Num (Matrix t), Numeric t) => Num (Dim m (Dim n (Matrix t))) | |||
357 | negate = (lift1F . lift1F) negate | 357 | negate = (lift1F . lift1F) negate |
358 | fromInteger x = Dim (Dim (fromInteger x)) | 358 | fromInteger x = Dim (Dim (fromInteger x)) |
359 | 359 | ||
360 | instance (Num (Vector t), Num (Matrix t), Numeric t) => Fractional (Dim m (Dim n (Matrix t))) | 360 | instance (Num (Vector t), Num (Matrix t), Fractional t, Numeric t) => Fractional (Dim m (Dim n (Matrix t))) |
361 | where | 361 | where |
362 | fromRational x = Dim (Dim (fromRational x)) | 362 | fromRational x = Dim (Dim (fromRational x)) |
363 | (/) = (lift2F.lift2F) (/) | 363 | (/) = (lift2F.lift2F) (/) |
364 | 364 | ||
365 | instance (Num (Vector t), Floating (Matrix t), Numeric t) => Floating (Dim m (Dim n (Matrix t))) where | 365 | instance (Num (Vector t), Floating (Matrix t), Fractional t, Numeric t) => Floating (Dim m (Dim n (Matrix t))) where |
366 | sin = (lift1F . lift1F) sin | 366 | sin = (lift1F . lift1F) sin |
367 | cos = (lift1F . lift1F) cos | 367 | cos = (lift1F . lift1F) cos |
368 | tan = (lift1F . lift1F) tan | 368 | tan = (lift1F . lift1F) tan |