diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-06-29 12:36:03 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-06-29 12:40:02 +0200 |
commit | 260e00c3d661c21de5986ccf01d3292d3b8f7633 (patch) | |
tree | 4e29bed0adb2724ac48e61abf5376ba613ff1c2a /src/Data/Array/Nested/Convert.hs | |
parent | 64404591661d3bc239804a1c17a25f81c434d852 (diff) |
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.
Diffstat (limited to 'src/Data/Array/Nested/Convert.hs')
-rw-r--r-- | src/Data/Array/Nested/Convert.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Array/Nested/Convert.hs b/src/Data/Array/Nested/Convert.hs index b68c8b0..861bf20 100644 --- a/src/Data/Array/Nested/Convert.hs +++ b/src/Data/Array/Nested/Convert.hs @@ -175,7 +175,7 @@ convert = \c x -> munScalar (go c (mscalar x)) go (ConvXR @_ @sh) (M_Nest @esh esh x) | Refl <- lemRankAppRankEqRepNo (Proxy @esh) (Proxy @sh) = let ssx' = ssxAppend (ssxFromShX esh) - (ssxReplicate (shxRank (shxDropSSX @esh @sh (mshape x) (ssxFromShX esh)))) + (ssxReplicate (shxRank (shxDropSSX @esh @sh (ssxFromShX esh) (mshape x)))) in M_Ranked (M_Nest esh (mcast ssx' x)) go ConvXS (M_Nest esh x) = M_Shaped (M_Nest esh x) go (ConvXS' @sh @sh' sh') (M_Nest @esh esh x) @@ -197,7 +197,7 @@ convert = \c x -> munScalar (go c (mscalar x)) = x go (ConvNest @_ @sh @sh' ssh) (M_Nest @esh esh x) | Refl <- lemAppAssoc (Proxy @esh) (Proxy @sh) (Proxy @sh') - = M_Nest esh (M_Nest (shxTakeSSX (Proxy @sh') (mshape x) (ssxFromShX esh `ssxAppend` ssh)) x) + = M_Nest esh (M_Nest (shxTakeSSX (Proxy @sh') (ssxFromShX esh `ssxAppend` ssh) (mshape x)) x) go (ConvUnnest @sh @sh') (M_Nest @esh esh (M_Nest _ x)) | Refl <- lemAppAssoc (Proxy @esh) (Proxy @sh) (Proxy @sh') = M_Nest esh x |