aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Mixed/Shape.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Array/Mixed/Shape.hs')
-rw-r--r--src/Data/Array/Mixed/Shape.hs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Data/Array/Mixed/Shape.hs b/src/Data/Array/Mixed/Shape.hs
index e46105d..95cd4ef 100644
--- a/src/Data/Array/Mixed/Shape.hs
+++ b/src/Data/Array/Mixed/Shape.hs
@@ -81,9 +81,9 @@ listxFold f (x ::% xs) = f x <> listxFold f xs
listxLength :: ListX sh f -> Int
listxLength = getSum . listxFold (\_ -> Sum 1)
-listxLengthSNat :: ListX sh f -> SNat (Rank sh)
-listxLengthSNat ZX = SNat
-listxLengthSNat (_ ::% l) | SNat <- listxLengthSNat l = SNat
+listxRank :: ListX sh f -> SNat (Rank sh)
+listxRank ZX = SNat
+listxRank (_ ::% l) | SNat <- listxRank l = SNat
listxShow :: forall sh f. (forall n. f n -> ShowS) -> ListX sh f -> ShowS
listxShow f l = showString "[" . go "" l . showString "]"
@@ -265,8 +265,8 @@ instance NFData i => NFData (ShX sh i) where
shxLength :: ShX sh i -> Int
shxLength (ShX l) = listxLength l
-shxLengthSNat :: ShX sh f -> SNat (Rank sh)
-shxLengthSNat (ShX list) = listxLengthSNat list
+shxRank :: ShX sh f -> SNat (Rank sh)
+shxRank (ShX list) = listxRank list
-- | This is more than @geq@: it also checks that the integers (the unknown
-- dimensions) are the same.
@@ -344,10 +344,6 @@ shxEnum = \sh -> go sh id []
go ZSX f = (f ZIX :)
go (n :$% sh) f = foldr (.) id [go sh (f . (i :.%)) | i <- [0 .. fromSMayNat' n - 1]]
-shxRank :: ShX sh f -> SNat (Rank sh)
-shxRank ZSX = SNat
-shxRank (_ :$% sh) | SNat <- shxRank sh = SNat
-
-- * Static mixed shapes