feldspar-language-0.7: A functional embedded language for DSP and parallelism

Safe HaskellSafe-Inferred
LanguageHaskell2010

Feldspar.Core.Collection

Description

General interfaces to collections of data

Synopsis

Documentation

type family Elem a Source

Collection element type

Instances

type Elem (Data [a]) = Data a 
type Elem (Vector a) = a 
type Elem (BitVector w) = Data Bool 
type Elem (Stream a) = a 
type Elem (Vector sh a) = a 

type family CollIndex a Source

Collection index type

Instances

type CollIndex (Data [a]) = Data Index 
type CollIndex (Vector a) = Data Index 
type CollIndex (BitVector w) = Data Index 
type CollIndex (Stream a) = Data Index 
type CollIndex (Vector sh a) = sh 

type family CollSize a Source

Collection size type

Instances

type CollSize (Data [a]) = Data Length 
type CollSize (Vector a) = Data Length 
type CollSize (BitVector w) = Data Length 
type CollSize (Vector sh a) = sh 

class Indexed a where Source

Data structures that support indexing

Methods

(!) :: a -> CollIndex a -> Elem a infixl 9 Source

Instances

Type a => Indexed (Data [a]) 
Syntax a => Indexed (Vector a) 
(Unit w, (~) * (Size w) (Range w)) => Indexed (BitVector w) 
Syntax a => Indexed (Stream a) 
Syntax a => Indexed (Vector sh a) 

class Sized a where Source

Sized data structures

Methods

collSize :: a -> CollSize a Source

setCollSize :: CollSize a -> a -> a Source

Instances

Type a => Sized (Data [a]) 
Syntax a => Sized (Vector a) 
(Syntax a, Shape sh) => Sized (Vector sh a) 

class CollMap a b where Source

Mapping over collections

Methods

collMap :: (Elem a -> Elem b) -> a -> b Source

Instances

(Type a, Type b) => CollMap (Data [a]) (Data [b]) 
CollMap (Vector a) (Vector b) 
CollMap (Vector sh a) (Vector sh a)