aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-11-12 11:47:11 +0100
committerTom Smeding <tom@tomsmeding.com>2024-11-12 11:47:11 +0100
commit0f0b526442cc97fa76772b88270eecf644d79326 (patch)
tree6e99fdaea0b84987f9423cd246798063173ec236 /src/Data/Array
parentc5b11c52ef3353fd64cad337edc67b6287db09fb (diff)
Make fromInteger error for all array types
They made no sense anyway, and horde-ad should now not use them any more
Diffstat (limited to 'src/Data/Array')
-rw-r--r--src/Data/Array/Nested/Internal/Mixed.hs2
-rw-r--r--src/Data/Array/Nested/Internal/Ranked.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Array/Nested/Internal/Mixed.hs b/src/Data/Array/Nested/Internal/Mixed.hs
index a979bf1..29d4ba0 100644
--- a/src/Data/Array/Nested/Internal/Mixed.hs
+++ b/src/Data/Array/Nested/Internal/Mixed.hs
@@ -241,7 +241,7 @@ instance (NumElt a, PrimElt a, Num a) => Num (Mixed sh a) where
abs = mliftNumElt1 numEltAbs
signum = mliftNumElt1 numEltSignum
-- TODO: THIS IS BAD, WE NEED TO REMOVE THIS
- fromInteger n = unsafeCoerce @(Mixed '[] a) @(Mixed sh a) $ fromPrimitive $ M_Primitive ZSX (X.scalar (fromInteger n))
+ fromInteger = error "Mixed(fromInteger): Cannot implement fromInteger, use mreplicateScal"
instance (FloatElt a, NumElt a, PrimElt a, Num a) => Fractional (Mixed sh a) where
fromRational _ = error "Data.Array.Nested.fromRational: No singletons available, use explicit mreplicate"
diff --git a/src/Data/Array/Nested/Internal/Ranked.hs b/src/Data/Array/Nested/Internal/Ranked.hs
index e5ed3af..39a6018 100644
--- a/src/Data/Array/Nested/Internal/Ranked.hs
+++ b/src/Data/Array/Nested/Internal/Ranked.hs
@@ -197,7 +197,7 @@ instance (NumElt a, PrimElt a, Num a) => Num (Ranked n a) where
negate = arithPromoteRanked negate
abs = arithPromoteRanked abs
signum = arithPromoteRanked signum
- fromInteger = Ranked . fromInteger
+ fromInteger = error "Ranked(fromInteger): Cannot implement fromInteger, use rreplicateScal"
instance (FloatElt a, NumElt a, PrimElt a, Num a) => Fractional (Ranked n a) where
fromRational _ = error "Data.Array.Nested.fromRational: No singletons available, use explicit rreplicateScal"