aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal/Shape.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-13 13:09:04 +0200
committerTom Smeding <tom@tomsmeding.com>2024-06-13 13:09:04 +0200
commit20173c939486ed6e27b8170e94f666d8ae3df152 (patch)
tree36c02005c3f2a20567388c6291e54bc2e4a4e6db /src/Data/Array/Nested/Internal/Shape.hs
parent275847827d7550436eaf8cd10969f1430dae821d (diff)
Rename *LengthSNat to *Rank
Diffstat (limited to 'src/Data/Array/Nested/Internal/Shape.hs')
-rw-r--r--src/Data/Array/Nested/Internal/Shape.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Data/Array/Nested/Internal/Shape.hs b/src/Data/Array/Nested/Internal/Shape.hs
index 7d95f61..4fa4284 100644
--- a/src/Data/Array/Nested/Internal/Shape.hs
+++ b/src/Data/Array/Nested/Internal/Shape.hs
@@ -91,14 +91,14 @@ listrIndex SZ (x ::: _) = x
listrIndex (SS i) (_ ::: xs) | Refl <- lemLeqSuccSucc (Proxy @k) (Proxy @n) = listrIndex i xs
listrIndex _ ZR = error "k + 1 <= 0"
-listrLengthSNat :: ListR n i -> SNat n
-listrLengthSNat ZR = SNat
-listrLengthSNat (_ ::: (sh :: ListR n i)) = snatSucc (listrLengthSNat sh)
+listrRank :: ListR n i -> SNat n
+listrRank ZR = SNat
+listrRank (_ ::: (sh :: ListR n i)) = snatSucc (listrRank sh)
listrPermutePrefix :: forall i n. [Int] -> ListR n i -> ListR n i
listrPermutePrefix = \perm sh ->
listrFromList perm $ \sperm ->
- case (listrLengthSNat sperm, listrLengthSNat sh) of
+ case (listrRank sperm, listrRank sh) of
(permlen@SNat, shlen@SNat) -> case cmpNat permlen shlen of
LTI -> let (pre, post) = listrSplitAt permlen sh in listrAppend (applyPermRFull permlen sperm pre) post
EQI -> let (pre, post) = listrSplitAt permlen sh in listrAppend (applyPermRFull permlen sperm pre) post
@@ -168,8 +168,8 @@ ixrTail (IxR list) = IxR (listrTail list)
ixrAppend :: forall n m i. IxR n i -> IxR m i -> IxR (n + m) i
ixrAppend = coerce (listrAppend @_ @i)
-ixrLengthSNat :: IxR n i -> SNat n
-ixrLengthSNat (IxR sh) = listrLengthSNat sh
+ixrRank :: IxR n i -> SNat n
+ixrRank (IxR sh) = listrRank sh
ixrPermutePrefix :: forall n i. [Int] -> IxR n i -> IxR n i
ixrPermutePrefix = coerce (listrPermutePrefix @i)
@@ -237,8 +237,8 @@ shrTail (ShR list) = ShR (listrTail list)
shrAppend :: forall n m i. ShR n i -> ShR m i -> ShR (n + m) i
shrAppend = coerce (listrAppend @_ @i)
-shrLengthSNat :: ShR n i -> SNat n
-shrLengthSNat (ShR sh) = listrLengthSNat sh
+shrRank :: ShR n i -> SNat n
+shrRank (ShR sh) = listrRank sh
shrPermutePrefix :: forall n i. [Int] -> ShR n i -> ShR n i
shrPermutePrefix = coerce (listrPermutePrefix @i)