From a3149a6e039516e984f745cd6260ce95bf80dee4 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 20 Apr 2024 22:52:23 +0200 Subject: slice --- src/Data/Array/Mixed.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Data/Array/Mixed.hs') diff --git a/src/Data/Array/Mixed.hs b/src/Data/Array/Mixed.hs index e7d2b69..164f832 100644 --- a/src/Data/Array/Mixed.hs +++ b/src/Data/Array/Mixed.hs @@ -363,3 +363,6 @@ fromList ssh l toList :: Storable a => XArray (n : sh) a -> [XArray sh a] toList (XArray arr) = coerce (ORB.toList (S.unravel arr)) + +slice :: [(Int, Int)] -> XArray sh a -> XArray sh a +slice ivs (XArray arr) = XArray (S.slice ivs arr) -- cgit v1.2.3-70-g09d2