| 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 aSource
Identity function, used as the vectorised version of fromPArrayP.
toPArrayPP :: PA a => PArray a :-> PArray aSource
Identity function, used as the vectorised version of toPArrayP.
fromNestedPArrayPP :: PA a => PArray (PArray a) :-> PArray (PArray a)Source
Identity function, used as the vectorised version of fromNestedPArrayP
Constructors
singletonPP :: PA a => a :-> PArray aSource
O(1). Construct an array containing a single element.
replicatePP :: PA a => Int :-> (a :-> PArray a)Source
O(n). Construct an array of the given size, that maps all elements to the same value.
Projections
indexPP :: PA a => PArray a :-> (Int :-> a)Source
O(1). Lookup a single element from the source array.
slicePP :: PA a => Int :-> (Int :-> (PArray a :-> PArray a))Source
O(len slice). Extract a range of elements from an array.
Traversals
mapPP :: (PA a, PA b) => (a :-> b) :-> (PArray a :-> PArray b)Source
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))Source
Apply a worker function to every pair of two arrays.
Filtering
filterPP :: PA a => (a :-> Bool) :-> (PArray a :-> PArray a)Source
Extract the elements from an array that match the given predicate.