diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-12 23:24:33 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-12 23:24:33 +0100 |
commit | bcda5b7eb20874f948fbdc23b6daa3ebb792ffe0 (patch) | |
tree | f2ea02510688f3b8684626673f5ad0572e4c65bd /src/Data/Array/Nested/Internal/Mixed.hs | |
parent | 11c3fda9ff63c466566e1f1375f5d8ae03833c90 (diff) |
Remove redundant constraints on arith instances
Diffstat (limited to 'src/Data/Array/Nested/Internal/Mixed.hs')
-rw-r--r-- | src/Data/Array/Nested/Internal/Mixed.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 |