From 260e00c3d661c21de5986ccf01d3292d3b8f7633 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 29 Jun 2025 12:36:03 +0200 Subject: Flip some index/shape-related functions This ensures that the argument order consistently puts the main thing being operated on at the end, and supporting singletons at the start. --- src/Data/Array/Nested/Shaped.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Data/Array/Nested/Shaped.hs') diff --git a/src/Data/Array/Nested/Shaped.hs b/src/Data/Array/Nested/Shaped.hs index 0275aad..2b0b6b5 100644 --- a/src/Data/Array/Nested/Shaped.hs +++ b/src/Data/Array/Nested/Shaped.hs @@ -186,7 +186,7 @@ srerankP :: forall sh1 sh2 sh a b. (Storable a, Storable b) srerankP sh sh2 f sarr@(Shaped arr) | Refl <- lemMapJustApp sh (Proxy @sh1) , Refl <- lemMapJustApp sh (Proxy @sh2) - = Shaped (mrerankP (ssxFromShX (shxTakeSSX (Proxy @(MapJust sh1)) (shxFromShS (sshape sarr)) (ssxFromShX (shxFromShS sh)))) + = Shaped (mrerankP (ssxFromShX (shxTakeSSX (Proxy @(MapJust sh1)) (ssxFromShX (shxFromShS sh)) (shxFromShS (sshape sarr)))) (shxFromShS sh2) (\a -> let Shaped r = f (Shaped a) in r) arr) -- cgit v1.2.3-70-g09d2