aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-17 23:56:06 +0200
committerTom Smeding <tom@tomsmeding.com>2024-06-17 23:56:06 +0200
commitd3cff40181b2b68a97a26012e1f26f702d57e5f1 (patch)
tree88456c5dd6ad69e8d20dcf3a6f6fa187f024a089 /src
parent9b0651bf19e889dfb28ba81b6ada25b27b0e6071 (diff)
Add same-size constraint to sreshape
Thanks Mikolaj :)
Diffstat (limited to 'src')
-rw-r--r--src/Data/Array/Nested/Internal/Shaped.hs2
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 ea979fa..d013959 100644
--- a/src/Data/Array/Nested/Internal/Shaped.hs
+++ b/src/Data/Array/Nested/Internal/Shaped.hs
@@ -399,7 +399,7 @@ sslice i n@SNat arr =
srev1 :: Elt a => Shaped (n : sh) a -> Shaped (n : sh) a
srev1 arr = slift (sshape arr) (\_ -> X.rev1) arr
-sreshape :: Elt a => ShS sh' -> Shaped sh a -> Shaped sh' a
+sreshape :: (Elt a, Product sh ~ Product sh') => ShS sh' -> Shaped sh a -> Shaped sh' a
sreshape sh' (Shaped arr) = Shaped (mreshape (shCvtSX sh') arr)
sflatten :: Elt a => Shaped sh a -> Shaped '[Product sh] a