aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Mixed
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2026-04-04 23:08:58 +0200
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2026-04-04 23:52:03 +0200
commit67b62499a6d60fed9489f0371a8c841beb0c308f (patch)
treeb83d488760d2fcc6cf4be73c890824e8e6bc2480 /src/Data/Array/Nested/Mixed
parentdec7d6c47fe9b783e1a98008a4efffb77df6f393 (diff)
Use lazilyConcat for listxAppend
Diffstat (limited to 'src/Data/Array/Nested/Mixed')
-rw-r--r--src/Data/Array/Nested/Mixed/Shape.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs
index 611ec19..54a945b 100644
--- a/src/Data/Array/Nested/Mixed/Shape.hs
+++ b/src/Data/Array/Nested/Mixed/Shape.hs
@@ -71,9 +71,8 @@ listxHead (i ::% _) = i
listxTail :: ListX (n : sh) i -> ListX sh i
listxTail (_ ::% sh) = sh
-listxAppend :: ListX sh i -> ListX sh' i -> ListX (sh ++ sh') i
-listxAppend ZX idx' = idx'
-listxAppend (i ::% idx) idx' = i ::% listxAppend idx idx'
+listxAppend :: forall sh sh' i. ListX sh i -> ListX sh' i -> ListX (sh ++ sh') i
+listxAppend = lazilyConcat (++)
listxDrop :: forall i j sh sh'. ListX sh j -> ListX (sh ++ sh') i -> ListX sh' i
listxDrop ZX long = long
@@ -147,7 +146,7 @@ ixxTail :: IxX (n : sh) i -> IxX sh i
ixxTail (IxX list) = IxX (listxTail list)
ixxAppend :: forall sh sh' i. IxX sh i -> IxX sh' i -> IxX (sh ++ sh') i
-ixxAppend = coerce (listxAppend @_ @i)
+ixxAppend = coerce (listxAppend @_ @_ @i)
ixxDrop :: forall sh sh' i. IxX sh i -> IxX (sh ++ sh') i -> IxX sh' i
ixxDrop = coerce (listxDrop @i @i)