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

Safe HaskellSafe-Infered




data D Source

Delayed arrays are represented as functions from the index to element value.

Every time you index into a delayed array the element at that position is recomputed.


Repr D a

Compute elements of a delayed array.

(Fillable r2 e, Elt e) => FillRange D r2 DIM2 e

Compute a range of elements in a rank-2 array.

(Fillable r2 e, Shape sh) => Fill D r2 sh e

Compute all elements in an array.

Combine D a D b 
Combine B Word8 D b 
Storable a => Combine F a D b 
Unbox a => Combine U a D b 

data family Array r sh e Source

Arrays with a representation tag, shape, and element type. Use one of the type tags like D, U and so on for r, one of DIM1, DIM2 ... for sh.

fromFunction :: sh -> (sh -> a) -> Array D sh aSource

O(1). Wrap a function as a delayed array.

toFunction :: (Shape sh, Repr r1 a) => Array r1 sh a -> (sh, sh -> a)Source

O(1). Produce the extent of an array, and a function to retrieve an arbitrary element.

delay :: (Shape sh, Repr r e) => Array r sh e -> Array D sh eSource

O(1). Delay an array. This wraps the internal representation to be a function from indices to elements, so consumers don't need to worry about what the previous representation was.