diff options
author | Mikolaj Konarski <mikolaj.konarski@gmail.com> | 2024-06-15 20:32:17 +0200 |
---|---|---|
committer | Mikolaj Konarski <mikolaj.konarski@gmail.com> | 2024-06-15 20:32:19 +0200 |
commit | 64f6a5552cffc10b9fbdb812166be8a0317367c0 (patch) | |
tree | 922781709b176c55079bef289cba4a7fd372ebb6 | |
parent | 46af04ce96ba9c9b0067039c822427db71074e57 (diff) |
Error out at fromInteger from the Num instance of Shaped
These are never indexes (only ranked tesors are), so writing explicit
sreplicateScal is not too big a burden for the user.
-rw-r--r-- | src/Data/Array/Nested/Internal/Shaped.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Data/Array/Nested/Internal/Shaped.hs b/src/Data/Array/Nested/Internal/Shaped.hs index be56030..2c24e6d 100644 --- a/src/Data/Array/Nested/Internal/Shaped.hs +++ b/src/Data/Array/Nested/Internal/Shaped.hs @@ -195,7 +195,7 @@ instance (NumElt a, PrimElt a, Num a) => Num (Shaped sh a) where negate = arithPromoteShaped negate abs = arithPromoteShaped abs signum = arithPromoteShaped signum - fromInteger = Shaped . fromInteger + fromInteger = error "Data.Array.Nested.fromInteger: No singletons available, use explicit sreplicateScal" instance (FloatElt a, NumElt a, PrimElt a, Num a) => Fractional (Shaped sh a) where fromRational _ = error "Data.Array.Nested.fromRational: No singletons available, use explicit sreplicateScal" |