aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-05-13 16:37:23 +0200
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2025-05-13 16:37:23 +0200
commit31eff15c7f8f062748cda6c7b86c5b38818d9035 (patch)
tree705519e8f7c637edc34a9a962a50255d4300e9b7 /src/Data/Array/Nested/Internal
parent27bf275c8dc57e5a0910fb8d51a1a2d521c95d8c (diff)
Add a couple of new zip operations that obviously make sense
Diffstat (limited to 'src/Data/Array/Nested/Internal')
-rw-r--r--src/Data/Array/Nested/Internal/Shape.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal/Shape.hs b/src/Data/Array/Nested/Internal/Shape.hs
index 82b7966..490c9a8 100644
--- a/src/Data/Array/Nested/Internal/Shape.hs
+++ b/src/Data/Array/Nested/Internal/Shape.hs
@@ -333,6 +333,12 @@ shrLast (ShR list) = listrLast list
shrAppend :: forall n m i. ShR n i -> ShR m i -> ShR (n + m) i
shrAppend = coerce (listrAppend @_ @i)
+shrZip :: ShR n i -> ShR n j -> ShR n (i, j)
+shrZip (ShR l1) (ShR l2) = ShR $ listrZip l1 l2
+
+shrZipWith :: (i -> j -> k) -> ShR n i -> ShR n j -> ShR n k
+shrZipWith f (ShR l1) (ShR l2) = ShR $ listrZipWith f l1 l2
+
shrPermutePrefix :: forall n i. [Int] -> ShR n i -> ShR n i
shrPermutePrefix = coerce (listrPermutePrefix @i)