repa-3.4.1.3: High performance, regular, shape polymorphic parallel arrays.

Safe HaskellNone
LanguageHaskell98

Data.Array.Repa.Operators.Selection

Synopsis

Documentation

selectP Source #

Arguments

:: (Unbox a, Monad m) 
=> (Int -> Bool)

If the Int matches this predicate,

-> (Int -> a)

... then pass it to this fn to produce a value

-> Int

Range between 0 and this maximum.

-> m (Array U DIM1 a)

Array containing produced values.

Produce an array by applying a predicate to a range of integers. If the predicate matches, then use the second function to generate the element.

  • This is a low-level function helpful for writing filtering operations on arrays.
  • Use the integer as the index into the array you're filtering.