diff options
Diffstat (limited to 'src/Data/Array/Nested/Mixed')
| -rw-r--r-- | src/Data/Array/Nested/Mixed/Shape.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs index ed03310..8aa5a77 100644 --- a/src/Data/Array/Nested/Mixed/Shape.hs +++ b/src/Data/Array/Nested/Mixed/Shape.hs @@ -217,9 +217,7 @@ 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 + toList = ixxToList null ZIX = False null _ = True @@ -242,6 +240,10 @@ ixxZero' (_ :$% sh) = 0 :.% ixxZero' sh ixxFromList :: forall sh i. StaticShX sh -> [i] -> IxX sh i ixxFromList = coerce (listxFromList @_ @i) +{-# INLINEABLE ixxToList #-} +ixxToList :: forall sh i. IxX sh i -> [i] +ixxToList = coerce (listxToList @_ @i) + ixxHead :: IxX (n : sh) i -> i ixxHead (IxX list) = getConst (listxHead list) |
