From d3cff40181b2b68a97a26012e1f26f702d57e5f1 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 17 Jun 2024 23:56:06 +0200 Subject: Add same-size constraint to sreshape Thanks Mikolaj :) --- src/Data/Array/Nested/Internal/Shaped.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2