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

Safe Haskell | Safe-Inferred

Feldspar.Core.Collection

Description

General interfaces to collections of data

Synopsis

- type family Elem a
- type family CollIndex a
- type family CollSize a
- class Indexed a where
  - (!) :: a -> CollIndex a -> Elem a
- class Sized a where
  - collSize :: a -> CollSize a
  - setCollSize :: CollSize a -> a -> a
- class CollMap a b where
  - collMap :: (Elem a -> Elem b) -> a -> b

# Documentation

type family Elem a

Collection element type

type family CollIndex a

Collection index type

type family CollSize a

Collection size type

class Indexed a where

Data structures that support indexing

Methods

(!) :: a -> CollIndex a -> Elem a

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

Sized data structures

Methods

collSize :: a -> CollSize a

setCollSize :: CollSize a -> a -> a

Instances

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

class CollMap a b where

Mapping over collections

Methods

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

Instances

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