diff options
author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-13 16:37:23 +0200 |
---|---|---|
committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-13 16:37:23 +0200 |
commit | 31eff15c7f8f062748cda6c7b86c5b38818d9035 (patch) | |
tree | 705519e8f7c637edc34a9a962a50255d4300e9b7 /src/Data/Array/Nested/Internal/Shape.hs | |
parent | 27bf275c8dc57e5a0910fb8d51a1a2d521c95d8c (diff) |
Add a couple of new zip operations that obviously make sense
Diffstat (limited to 'src/Data/Array/Nested/Internal/Shape.hs')
-rw-r--r-- | src/Data/Array/Nested/Internal/Shape.hs | 6 |
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) |