diff options
Diffstat (limited to 'src/Data/Array/Nested/Shaped/Shape.hs')
| -rw-r--r-- | src/Data/Array/Nested/Shaped/Shape.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Data/Array/Nested/Shaped/Shape.hs b/src/Data/Array/Nested/Shaped/Shape.hs index 3d4bf31..d1a72ea 100644 --- a/src/Data/Array/Nested/Shaped/Shape.hs +++ b/src/Data/Array/Nested/Shaped/Shape.hs @@ -314,10 +314,12 @@ shsLength :: ShS sh -> Int shsLength (ShS shx) = shxLength shx shsRank :: forall sh. ShS sh -> SNat (Rank sh) -shsRank (ShS shx) = - gcastWith (unsafeCoerceRefl :: Rank (MapJust sh) :~: Rank sh) $ +shsRank (ShS shx) | Refl <- lemRankMapJust (Proxy @sh) = shxRank shx +lemRankMapJust :: proxy sh -> Rank (MapJust sh) :~: Rank sh +lemRankMapJust _ = unsafeCoerceRefl + shsSize :: ShS sh -> Int shsSize (ShS sh) = shxSize sh |
