aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Mixed/Shape.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Array/Nested/Mixed/Shape.hs')
-rw-r--r--src/Data/Array/Nested/Mixed/Shape.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs
index a9ed2d0..4626481 100644
--- a/src/Data/Array/Nested/Mixed/Shape.hs
+++ b/src/Data/Array/Nested/Mixed/Shape.hs
@@ -140,6 +140,7 @@ listxFromList topssh topl = go topssh topl
++ show (ssxLength topssh) ++ ", list has length "
++ show (length topl) ++ ")"
+{-# INLINEABLE listxToList #-}
listxToList :: ListX sh' (Const i) -> [i]
listxToList ZX = []
listxToList (Const i ::% is) = i : listxToList is
@@ -219,6 +220,9 @@ instance Foldable (IxX sh) where
{-# INLINE foldr #-}
foldr _ z ZIX = z
foldr f z (x :.% xs) = f x (foldr f z xs)
+ {-# INLINEABLE toList #-}
+ toList ZIX = []
+ toList (i :.% is) = i : Foldable.toList is
null ZIX = False
null _ = True
@@ -441,6 +445,7 @@ shxFromList topssh topl = go topssh topl
++ show (ssxLength topssh) ++ ", list has length "
++ show (length topl) ++ ")"
+{-# INLINEABLE shxToList #-}
shxToList :: IShX sh -> [Int]
shxToList ZSX = []
shxToList (smn :$% sh) = fromSMayNat' smn : shxToList sh