summaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-05-14 13:01:22 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-05-14 13:01:22 +0200
commitd0b8d7c8935dc1bf6fbb09c752707a82bc066808 (patch)
treea6cb8897bb201c87e1d8d2dd333b16781f8f6695 /src/Data/Array/Nested
parentb17676f566bc178be3eff4351a61b6368bdb9fe7 (diff)
rev1
Diffstat (limited to 'src/Data/Array/Nested')
-rw-r--r--src/Data/Array/Nested/Internal.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs
index 4a03548..350eb6f 100644
--- a/src/Data/Array/Nested/Internal.hs
+++ b/src/Data/Array/Nested/Internal.hs
@@ -537,6 +537,9 @@ mconstant sh x = fromPrimitive (mconstantP sh x)
mslice :: (KnownShapeX sh, Elt a) => [(Int, Int)] -> Mixed sh a -> Mixed sh a
mslice ivs = mlift $ \_ -> X.slice ivs
+mrev1 :: (KnownShapeX (n : sh), Elt a) => Mixed (n : sh) a -> Mixed (n : sh) a
+mrev1 = mlift $ \_ -> X.rev1
+
mliftPrim :: (KnownShapeX sh, Storable a)
=> (a -> a)
-> Mixed sh (Primitive a) -> Mixed sh (Primitive a)
@@ -1077,6 +1080,9 @@ rconstant sh x = coerce fromPrimitive (rconstantP sh x)
rslice :: (KnownINat n, Elt a) => [(Int, Int)] -> Ranked n a -> Ranked n a
rslice ivs = rlift $ \_ -> X.slice ivs
+rrev1 :: (KnownINat n, Elt a) => Ranked (S n) a -> Ranked (S n) a
+rrev1 = rlift $ \_ -> X.rev1
+
-- ====== API OF SHAPED ARRAYS ====== --
@@ -1283,3 +1289,6 @@ sconstant x = coerce fromPrimitive (sconstantP @sh x)
sslice :: (KnownShape sh, Elt a) => [(Int, Int)] -> Shaped sh a -> Shaped sh a
sslice ivs = slift $ \_ -> X.slice ivs
+
+srev1 :: (KnownNat n, KnownShape sh, Elt a) => Shaped (n : sh) a -> Shaped (n : sh) a
+srev1 = slift $ \_ -> X.rev1