From b1b445697db31b1603a31747ca31151f97ee7263 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 23 May 2015 12:31:32 +0200 Subject: join SContainer and Container using Fractional contexts --- packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/base/src/Numeric/LinearAlgebra/Static') 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)) negate = lift1F negate fromInteger x = Dim (fromInteger x) -instance (Num (Vector t), Num (Matrix t), Numeric t) => Fractional (Dim n (Vector t)) +instance (Num (Vector t), Num (Matrix t), Fractional t, Numeric t) => Fractional (Dim n (Vector t)) where fromRational x = Dim (fromRational x) (/) = lift2F (/) -instance (Floating (Vector t), Numeric t) => Floating (Dim n (Vector t)) where +instance (Fractional t, Floating (Vector t), Numeric t) => Floating (Dim n (Vector t)) where sin = lift1F sin cos = lift1F cos tan = lift1F tan @@ -357,12 +357,12 @@ instance (Num (Matrix t), Numeric t) => Num (Dim m (Dim n (Matrix t))) negate = (lift1F . lift1F) negate fromInteger x = Dim (Dim (fromInteger x)) -instance (Num (Vector t), Num (Matrix t), Numeric t) => Fractional (Dim m (Dim n (Matrix t))) +instance (Num (Vector t), Num (Matrix t), Fractional t, Numeric t) => Fractional (Dim m (Dim n (Matrix t))) where fromRational x = Dim (Dim (fromRational x)) (/) = (lift2F.lift2F) (/) -instance (Num (Vector t), Floating (Matrix t), Numeric t) => Floating (Dim m (Dim n (Matrix t))) where +instance (Num (Vector t), Floating (Matrix t), Fractional t, Numeric t) => Floating (Dim m (Dim n (Matrix t))) where sin = (lift1F . lift1F) sin cos = (lift1F . lift1F) cos tan = (lift1F . lift1F) tan -- cgit v1.2.3