dph-lifted-vseg- Data Parallel Haskell lifted array combinators.

Safe HaskellSafe-Infered




Defines the PRepr family and PA class that converts between the user level element types and our generic representation. Apart from unpackPA, the PA wrapper functions defined here all have equivalent PR versions in Data.Array.Parallel.PArray.PData, so see there for documentation.



type family PRepr a Source

Family of Representable types. These are the types that we know how to represent generically. PRepr takes an arbitrary type and produces the generic type we use to represent it.

Instances for simple types are defined by the library. For algebraic types, it's up to the vectoriser/client module to create a suitable instance.

class PR (PRepr a) => PA a whereSource

A PA dictionary contains the functions that we use to convert a representable type to and from its generic representation.

The conversions methods should all be O(1).


PA Bool 
PA Double 
PA Int 
PA Integer 
PA Ordering 
PA Word8 
PA () 
PA Void 
PA a => PA (PArray a) 
(PR a, PR b) => PA (Either a b) 
(PA a, PA b) => PA (a, b) 
(PA a, PA b) => PA (:-> a b) 
(PA a, PA b, PA c) => PA (a, b, c) 
(PA a, PA b, PA c, PA d) => PA (a, b, c, d) 
(PA a, PA b, PA c, PA d, PA e) => PA (a, b, c, d, e) 

toNestedArrPRepr :: PA a => PData (PArray a) -> PData (PArray (PRepr a))Source

Convert a nested array to its generic representation.

House Keeping

validPA :: PA a => PData a -> BoolSource

nfPA :: PA a => PData a -> ()Source

similarPA :: PA a => a -> a -> BoolSource

coversPA :: PA a => Bool -> PData a -> Int -> BoolSource

pprpPA :: PA a => a -> DocSource


replicatePA :: PA a => Int -> a -> PData aSource

appendPA :: PA a => PData a -> PData a -> PData aSource

appendsPA :: PA a => Segd -> Segd -> PData a -> Segd -> PData a -> PData aSource


lengthPA :: PA a => PData a -> IntSource

indexPA :: PA a => PData a -> Int -> aSource

indexsPA :: PA a => PDatas a -> Array (Int, Int) -> PData aSource

indexvsPA :: PA a => PDatas a -> VSegd -> Array (Int, Int) -> PData aSource

extractPA :: PA a => PData a -> Int -> Int -> PData aSource

Pack and Combine

packByTagPA :: PA a => PData a -> Array Tag -> Tag -> PData aSource

combine2PA :: PA a => Sel2 -> PData a -> PData a -> PData aSource



indexdPA :: PA a => PDatas a -> Int -> PData aSource

appenddPA :: PA a => PDatas a -> PDatas a -> PDatas aSource

Nested Arrays

mkPNestedPA :: PA a => VSegd -> PDatas a -> Segd -> PData a -> PData (PArray a)Source

Conatruct a nested array.

unconcatPA :: (PA a, PA b) => PData (PArray a) -> PData b -> PData (PArray b)Source

unpackPA :: PA a => PArray a -> PData (PRepr a)Source

Unpack an array to reveal its representation.

Tuple Arrays

ziplPA :: (PA a, PA b) => PData (PArray a) -> PData (PArray b) -> PData (PArray (a, b))Source

Lifted zip on PData arrays.