diff options
Diffstat (limited to 'src/Data/Array/Nested')
-rw-r--r-- | src/Data/Array/Nested/Internal.hs | 9 |
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 |