dph-par-0.5.1.1: Data structures for Nested Data-Parallel Haskell.

Data.Array.Parallel.Prelude

Description

This module (as well as the type-specific modules Data.Array.Parallel.Prelude.*) are a temporary kludge needed as DPH programs cannot directly use the (non-vectorised) functions from the standard Prelude. It also exports some conversion helpers.

This module should not be explicitly imported in user code anymore. User code should only import Data.Array.Parallel and, until the vectoriser supports type classes, the type-specific modules Data.Array.Parallel.Prelude.*.

Synopsis

Documentation

otherwise :: Bool

otherwise is defined as the value True. It helps to make guards more readable. eg.

  f x | x < 0     = ...
      | otherwise = ...

andP :: [:Bool:] -> BoolSource

orP :: [:Bool:] -> BoolSource

tup2 :: (PA a, PA b) => a :-> (b :-> (a, b))Source

tup3 :: (PA a, PA b, PA c) => a :-> (b :-> (c :-> (a, b, c)))Source

data PArray a Source

Lifted/bulk parallel arrays This contains the array length, along with the element data.

Instances

(PA a, Show a) => Show (PArray a) 
PR a => PR (PArray a) 
PA a => PA (PArray a) 

class Elt a => Scalar a whereSource

Class of scalar types. Scalar types are the ones that we can store in our underlying U.Arrays (which are currently implemented as Data.Vectors).

To perform an operation on a PData array of scalar elements, we coerce it to the underling U.Array and use the corresponding U.Array operators.

toUArrPA :: Scalar a => PArray a -> Array aSource

Convert a PArray back to a plain U.Array.

fromUArrPA' :: Scalar a => Array a -> PArray aSource

Create a PArray out of a scalar U.Array, reading the length directly from the U.Array.

fromUArrPA_2' :: (Scalar a, Scalar b) => Array (a, b) -> PArray (a, b)Source

Convert a U.Array of pairs to a PArray, reading the length directly from the U.Array.

fromUArrPA_3 :: (Scalar a, Scalar b, Scalar c) => Int -> Array ((a, b), c) -> PArray (a, b, c)Source

Convert a U.Array of triples to a PArray.

fromUArrPA_3' :: (Scalar a, Scalar b, Scalar c) => Array ((a, b), c) -> PArray (a, b, c)Source

Convert a U.Array of triples to a PArray, reading the length directly from the U.Array.

nestUSegdPA'Source

Arguments

:: Segd

segment descriptor

-> PArray a

array of data elements

-> PArray (PArray a) 

O(1). Create a nested array, using the same length as the source array.