accelerate-0.9.0.1: An embedded language for accelerated array processing

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Safe HaskellNone

Data.Array.Accelerate.Tuple

Contents

Description

Our representation of tuples are heterogenous snoc lists, which are typed by type lists, where '()' and '(,)' are type-level nil and snoc, respectively. The components may only be drawn from types that can be used as array elements.

Synopsis

Tuple representation

data Tuple c t whereSource

We represent tuples as heterogenous lists, typed by a type list.

Constructors

NilTup :: Tuple c () 
SnocTup :: Elt t => Tuple c s -> c t -> Tuple c (s, t) 

data TupleIdx t e whereSource

Type-safe projection indicies for tuples.

NB: We index tuples by starting to count from the *right*!

Constructors

ZeroTupIdx :: Elt s => TupleIdx (t, s) s 
SuccTupIdx :: TupleIdx t e -> TupleIdx (t, s) e 

class IsTuple tup whereSource

Conversion between surface n-tuples and our tuple representation.

Associated Types

type TupleRepr tup Source

Methods

fromTuple :: tup -> TupleRepr tupSource

toTuple :: TupleRepr tup -> tupSource

Instances

IsTuple () 
IsTuple (a, b) 
IsTuple (a, b, c) 
IsTuple (a, b, c, d) 
IsTuple (a, b, c, d, e) 
IsTuple (a, b, c, d, e, f) 
IsTuple (a, b, c, d, e, f, g) 
IsTuple (a, b, c, d, e, f, g, h) 
IsTuple (a, b, c, d, e, f, g, h, i)