summaryrefslogtreecommitdiff
path: root/src/Data/Array/Mixed.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-04-20 22:52:23 +0200
committerTom Smeding <tom@tomsmeding.com>2024-04-20 22:52:23 +0200
commita3149a6e039516e984f745cd6260ce95bf80dee4 (patch)
tree2ff5f955aaf5d229433bc80ee5114f1409ac95e9 /src/Data/Array/Mixed.hs
parentde1250a6837cc3b8cf168905e360845e9082c7d2 (diff)
slice
Diffstat (limited to 'src/Data/Array/Mixed.hs')
-rw-r--r--src/Data/Array/Mixed.hs3
1 files changed, 3 insertions, 0 deletions
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)