diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-06-29 13:07:22 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-06-29 13:07:22 +0200 |
commit | dc0270a1fd5db180df88023bb2628b046447df0d (patch) | |
tree | 2373f456d85ced87186ce93e38b1a9ec0d9775d4 /src/Data/Array/Nested/Shaped/Base.hs | |
parent | 260e00c3d661c21de5986ccf01d3292d3b8f7633 (diff) |
More shape/index conversion functions
Diffstat (limited to 'src/Data/Array/Nested/Shaped/Base.hs')
-rw-r--r-- | src/Data/Array/Nested/Shaped/Base.hs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Data/Array/Nested/Shaped/Base.hs b/src/Data/Array/Nested/Shaped/Base.hs index a24a91a..879e6b5 100644 --- a/src/Data/Array/Nested/Shaped/Base.hs +++ b/src/Data/Array/Nested/Shaped/Base.hs @@ -249,12 +249,7 @@ sshape (Shaped arr) = shsFromShX (mshape arr) shsFromShX :: forall sh i. ShX (MapJust sh) i -> ShS sh shsFromShX ZSX = castWith (subst1 (unsafeCoerceRefl :: '[] :~: sh)) ZSS shsFromShX (SKnown n@SNat :$% (idx :: ShX mjshT i)) = - castWith (subst1 (lem Refl)) $ + castWith (subst1 (sym (lemMapJustCons Refl))) $ n :$$ shsFromShX @(Tail sh) (castWith (subst2 (unsafeCoerceRefl :: mjshT :~: MapJust (Tail sh))) idx) - where - lem :: forall sh1 sh' n. - Just n : sh1 :~: MapJust sh' - -> n : Tail sh' :~: sh' - lem Refl = unsafeCoerceRefl shsFromShX (SUnknown _ :$% _) = error "impossible" |