From bcda5b7eb20874f948fbdc23b6daa3ebb792ffe0 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 12 Mar 2025 23:24:33 +0100 Subject: Remove redundant constraints on arith instances --- src/Data/Array/Nested/Internal/Mixed.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Data/Array/Nested/Internal/Mixed.hs') diff --git a/src/Data/Array/Nested/Internal/Mixed.hs b/src/Data/Array/Nested/Internal/Mixed.hs index b72581e..08f97f0 100644 --- a/src/Data/Array/Nested/Internal/Mixed.hs +++ b/src/Data/Array/Nested/Internal/Mixed.hs @@ -224,7 +224,7 @@ mliftNumElt2 f (toPrimitive -> M_Primitive sh1 (XArray arr1)) (toPrimitive -> M_ | sh1 == sh2 = fromPrimitive $ M_Primitive sh1 (XArray (f (shxRank sh1) arr1 arr2)) | otherwise = error $ "Data.Array.Nested: Shapes unequal in elementwise Num operation: " ++ show sh1 ++ " vs " ++ show sh2 -instance (NumElt a, PrimElt a, Num a) => Num (Mixed sh a) where +instance (NumElt a, PrimElt a) => Num (Mixed sh a) where (+) = mliftNumElt2 numEltAdd (-) = mliftNumElt2 numEltSub (*) = mliftNumElt2 numEltMul @@ -234,12 +234,12 @@ instance (NumElt a, PrimElt a, Num a) => Num (Mixed sh a) where -- TODO: THIS IS BAD, WE NEED TO REMOVE THIS fromInteger = error "Data.Array.Nested.fromInteger: Cannot implement fromInteger, use mreplicateScal" -instance (FloatElt a, PrimElt a, Num a) => Fractional (Mixed sh a) where +instance (FloatElt a, PrimElt a) => Fractional (Mixed sh a) where fromRational _ = error "Data.Array.Nested.fromRational: No singletons available, use explicit mreplicate" recip = mliftNumElt1 floatEltRecip (/) = mliftNumElt2 floatEltDiv -instance (FloatElt a, PrimElt a, Num a) => Floating (Mixed sh a) where +instance (FloatElt a, PrimElt a) => Floating (Mixed sh a) where pi = error "Data.Array.Nested.pi: No singletons available, use explicit mreplicate" exp = mliftNumElt1 floatEltExp log = mliftNumElt1 floatEltLog -- cgit v1.2.3-70-g09d2