| Safe Haskell | None |
|---|
Data.Array.Parallel.Lifted.Combinators
Description
Closure converted lifted array combinators. The vectoriser produces code that uses these combinators directly.
All of the combinators in this module are polymorphic, work on PArray, and
take PA dictionaries. Combinators that are specific to a certain element type,
like Int, are defined in the corresponding prelude module,
eg Data.Array.Parallel.Prelude.Int.
- fromPArrayPP :: PA a => PArray a :-> PArray a
- toPArrayPP :: PA a => PArray a :-> PArray a
- fromNestedPArrayPP :: PA a => PArray (PArray a) :-> PArray (PArray a)
- emptyPP :: PA a => PArray a
- singletonPP :: PA a => a :-> PArray a
- replicatePP :: PA a => Int :-> (a :-> PArray a)
- appendPP :: PA a => PArray a :-> (PArray a :-> PArray a)
- lengthPP :: PA a => PArray a :-> Int
- indexPP :: PA a => PArray a :-> (Int :-> a)
- slicePP :: PA a => Int :-> (Int :-> (PArray a :-> PArray a))
- mapPP :: (PA a, PA b) => (a :-> b) :-> (PArray a :-> PArray b)
- zipWithPP :: (PA a, PA b, PA c) => (a :-> (b :-> c)) :-> (PArray a :-> (PArray b :-> PArray c))
- crossMapPP :: (PA a, PA b) => PArray a :-> ((a :-> PArray b) :-> PArray (a, b))
- filterPP :: PA a => (a :-> Bool) :-> (PArray a :-> PArray a)
- concatPP :: PA a => PArray (PArray a) :-> PArray a
- zipPP :: (PA a, PA b) => PArray a :-> (PArray b :-> PArray (a, b))
- unzipPP :: (PA a, PA b) => PArray (a, b) :-> (PArray a, PArray b)
Conversions
fromPArrayPP :: PA a => PArray a :-> PArray a
Identity function, used as the vectorised version of fromPArrayP.
toPArrayPP :: PA a => PArray a :-> PArray a
Identity function, used as the vectorised version of toPArrayP.
fromNestedPArrayPP :: PA a => PArray (PArray a) :-> PArray (PArray a)
Identity function, used as the vectorised version of fromNestedPArrayP
Constructors
singletonPP :: PA a => a :-> PArray a
O(1). Construct an array containing a single element.
replicatePP :: PA a => Int :-> (a :-> PArray a)
O(n). Construct an array of the given size, that maps all elements to the same value.
Projections
slicePP :: PA a => Int :-> (Int :-> (PArray a :-> PArray a))
O(len slice). Extract a range of elements from an array.
Traversals
mapPP :: (PA a, PA b) => (a :-> b) :-> (PArray a :-> PArray b)
Apply a worker function to every element of an array.
zipWithPP :: (PA a, PA b, PA c) => (a :-> (b :-> c)) :-> (PArray a :-> (PArray b :-> PArray c))
Apply a worker function to every pair of two arrays.
Filtering
filterPP :: PA a => (a :-> Bool) :-> (PArray a :-> PArray a)
Extract the elements from an array that match the given predicate.