From 8c27d35a43a18c7c169ea67ba131b94f10c4b25b Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 14 Mar 2026 11:52:03 +0100 Subject: Variable naming and doc comments --- src/Data/Array/XArray.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Data/Array/XArray.hs') diff --git a/src/Data/Array/XArray.hs b/src/Data/Array/XArray.hs index f3a1053..4514043 100644 --- a/src/Data/Array/XArray.hs +++ b/src/Data/Array/XArray.hs @@ -351,18 +351,15 @@ toListOuter (XArray arr@(ORS.A (ORG.A shArr t))) = [_] | Refl <- (unsafeCoerceRefl :: sh :~: '[]) -> coerce (map S.scalar $ S.toList arr) n : sh -> coerce $ map (ORG.A sh . OI.indexT t) [0 .. n - 1] --- | If @n@ is an 'SKnown' dimension, the list is streamed. If @n@ is unknown, --- the list's spine must be fully materialised to compute its length before --- constructing the array. +-- | Performance note: the list's spine is fully materialised to compute its +-- length before traversing it again to construct the array. {-# INLINE fromList1 #-} fromList1 :: Storable a => [a] -> XArray '[Nothing] a fromList1 l = let n = length l -- avoid S.fromList because it takes a length _and_ does another length check itself in XArray (S.fromVector [n] (VS.fromListN n l)) --- | If @n@ is an 'SKnown' dimension, the list is streamed. If @n@ is unknown, --- the list's spine must be fully materialised to compute its length before --- constructing the array. +-- | The list is streamed. {-# INLINE fromList1SN #-} fromList1SN :: Storable a => SNat n -> [a] -> XArray '[Just n] a fromList1SN m l = -- cgit v1.2.3-70-g09d2