From 0028b655341069e83db6e0bfde01dea1c696f5aa Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Mon, 1 Dec 2025 17:15:05 +0100 Subject: Unify toList functions for shapes --- src/Data/Array/Nested/Ranked/Shape.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Data/Array/Nested/Ranked/Shape.hs') diff --git a/src/Data/Array/Nested/Ranked/Shape.hs b/src/Data/Array/Nested/Ranked/Shape.hs index 989d7d1..739f0de 100644 --- a/src/Data/Array/Nested/Ranked/Shape.hs +++ b/src/Data/Array/Nested/Ranked/Shape.hs @@ -79,6 +79,9 @@ instance Foldable (ListR n) where {-# INLINE foldr #-} foldr _ z ZR = z foldr f z (x ::: xs) = f x (foldr f z xs) + {-# INLINEABLE toList #-} + toList ZR = [] + toList (i ::: is) = i : Foldable.toList is null ZR = False null _ = True -- cgit v1.2.3-70-g09d2