dph-prim-par/seq: comments and formatting only
[packages/dph.git] / dph-prim-par / Data / Array / Parallel / Unlifted / Parallel / Subarrays.hs
1 {-# LANGUAGE CPP #-}
2
3 #include "fusion-phases.h"
4
5 -- | Subarrays of flat unlifted arrays.
6 module Data.Array.Parallel.Unlifted.Parallel.Subarrays (
7 dropUP
8 ) where
9 import Data.Array.Parallel.Unlifted.Sequential.Vector as Seq
10 import Data.Array.Parallel.Unlifted.Distributed
11
12
13 -- | Drop a the element at the provided index from a vector.
14 dropUP :: Unbox e => Int -> Vector e -> Vector e
15 {-# INLINE_U dropUP #-}
16 dropUP n xs
17 = Seq.slice xs (min (max 0 n) (Seq.length xs))
18 (min (Seq.length xs) (Seq.length xs - n))