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

Safe HaskellNone

Feldspar.Core.Types

Contents

Synopsis

Heterogenous lists

data a :> b Source

Heterogeneous list

Constructors

a :> b 

Instances

(Eq a, Eq b) => Eq (:> a b) 
(Eq (:> a b), Ord a, Ord b) => Ord (:> a b) 
(Show a, Show b) => Show (:> a b) 
(Eq (:> a b), Lattice a, Lattice b) => Lattice (:> a b) 

Integers

newtype WordN Source

Target-dependent unsigned integers

Constructors

WordN Word32 

newtype IntN Source

Target-dependent signed integers

Constructors

IntN Int32 

data N8 Source

Type representation of 8 bits

data N16 Source

Type representation of 16 bits

data N32 Source

Type representation of 32 bits

data N64 Source

Type representation of 64 bits

data NNative Source

Type representation of the native number of bits on the target

data BitWidth n whereSource

Witness for N8, N16, N32, N64 or NNative

data U Source

Type representation of "unsigned"

data S Source

Type representation of "signed"

data Signedness s whereSource

Witness for U or S

Constructors

U :: Signedness U 
S :: Signedness S 

type family GenericInt s n Source

A generalization of unsigned and signed integers. The first parameter represents the signedness and the sectond parameter the number of bits.

type family WidthOf a Source

type family SignOf a Source

Arrays

data TargetArr n a Source

Array whose length is represented by an n-bit word

Constructors

TargetArr (GenericInt U n) [a] 

Monadic Types

class MonadType m whereSource

This class is used to allow constructs to be abstract in the monad

Methods

voidTypeRep :: TypeRep (m ())Source

Mutable data

type Mut = IOSource

Monad for manipulation of mutable data

type MArr a = IOArray Index aSource

Mutable arrays

Par Monad

type Par = ParSource

Monad for parallel constructs

type IV = IVarSource

Immutable references

Future values

newtype FVal a Source

Constructors

FVal 

Fields

unFVal :: a
 

Instances

Typeable1 FVal 
Eq a => Eq (FVal a) 
Show (FVal a) 
(Eq (FVal a), Show (FVal a), Typeable (FVal a), Show (Size (FVal a)), Lattice (Size (FVal a)), Type a) => Type (FVal a) 

Type representation

data TypeRep a whereSource

Representation of supported types

Constructors

UnitType :: TypeRep () 
BoolType :: TypeRep Bool 
IntType :: (BoundedInt (GenericInt s n), Size (GenericInt s n) ~ Range (GenericInt s n)) => Signedness s -> BitWidth n -> TypeRep (GenericInt s n) 
FloatType :: TypeRep Float 
ComplexType :: RealFloat a => TypeRep a -> TypeRep (Complex a) 
ArrayType :: TypeRep a -> TypeRep [a] 
TargetArrType :: BitWidth n -> TypeRep a -> TypeRep (TargetArr n a) 
Tup2Type :: TypeRep a -> TypeRep b -> TypeRep (a, b) 
Tup3Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep (a, b, c) 
Tup4Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep (a, b, c, d) 
Tup5Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep (a, b, c, d, e) 
Tup6Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep f -> TypeRep (a, b, c, d, e, f) 
Tup7Type :: TypeRep a -> TypeRep b -> TypeRep c -> TypeRep d -> TypeRep e -> TypeRep f -> TypeRep g -> TypeRep (a, b, c, d, e, f, g) 
FunType :: TypeRep a -> TypeRep b -> TypeRep (a -> b) 
MutType :: TypeRep a -> TypeRep (Mut a) 
RefType :: TypeRep a -> TypeRep (IORef a) 
MArrType :: TypeRep a -> TypeRep (MArr a) 
ParType :: TypeRep a -> TypeRep (Par a) 
IVarType :: TypeRep a -> TypeRep (IV a) 
FValType :: TypeRep a -> TypeRep (FVal a) 

Instances

argType :: TypeRep (a -> b) -> TypeRep aSource

resType :: TypeRep (a -> b) -> TypeRep bSource

data TypeEq a b whereSource

Type equality witness

Constructors

TypeEq :: TypeEq a a 

signEq :: Signedness s1 -> Signedness s2 -> Maybe (TypeEq s1 s2)Source

Type equality on Signedness

widthEq :: BitWidth n1 -> BitWidth n2 -> Maybe (TypeEq n1 n2)Source

Type equality on BitWidth

typeEq :: TypeRep a -> TypeRep b -> Maybe (TypeEq a b)Source

Type equality on TypeRep

type family TargetType n a Source

class (Eq a, Show a, Typeable a, Show (Size a), Lattice (Size a)) => Type a whereSource

The set of supported types

Methods

typeRep :: TypeRep aSource

Gives the type representation a value.

sizeOf :: a -> Size aSource

toTarget :: BitWidth n -> a -> TargetType n aSource

Instances

Type Bool 
Type Float 
Type Int8 
Type Int16 
Type Int32 
Type Int64 
Type Word8 
Type Word16 
Type Word32 
Type Word64 
Type () 
Type IntN 
Type WordN 
(Eq [a], Show [a], Typeable [a], Show (Size [a]), Lattice (Size [a]), Type a) => Type [a] 
(Eq (Complex a), Show (Complex a), Typeable (Complex a), Show (Size (Complex a)), Lattice (Size (Complex a)), Type a, RealFloat a) => Type (Complex a) 
(Eq (IORef a), Typeable (IORef a), Show (Size (IORef a)), Lattice (Size (IORef a)), Type a, Show (IORef a)) => Type (IORef a) 
(Eq (FVal a), Show (FVal a), Typeable (FVal a), Show (Size (FVal a)), Lattice (Size (FVal a)), Type a) => Type (FVal a) 
(Eq (IV a), Show (IV a), Typeable (IV a), Show (Size (IV a)), Lattice (Size (IV a)), Type a) => Type (IV a) 
(Eq (MArr a), Show (MArr a), Typeable (MArr a), Show (Size (MArr a)), Lattice (Size (MArr a)), Type a) => Type (MArr a) 
(Eq (a, b), Show (a, b), Typeable (a, b), Show (Size (a, b)), Lattice (Size (a, b)), Type a, Type b) => Type (a, b) 
(Eq (a, b, c), Show (a, b, c), Typeable (a, b, c), Show (Size (a, b, c)), Lattice (Size (a, b, c)), Type a, Type b, Type c) => Type (a, b, c) 
(Eq (a, b, c, d), Show (a, b, c, d), Typeable (a, b, c, d), Show (Size (a, b, c, d)), Lattice (Size (a, b, c, d)), Type a, Type b, Type c, Type d) => Type (a, b, c, d) 
(Eq (a, b, c, d, e), Show (a, b, c, d, e), Typeable (a, b, c, d, e), Show (Size (a, b, c, d, e)), Lattice (Size (a, b, c, d, e)), Type a, Type b, Type c, Type d, Type e) => Type (a, b, c, d, e) 
(Eq (a, b, c, d, e, f), Show (a, b, c, d, e, f), Typeable (a, b, c, d, e, f), Show (Size (a, b, c, d, e, f)), Lattice (Size (a, b, c, d, e, f)), Type a, Type b, Type c, Type d, Type e, Type f) => Type (a, b, c, d, e, f) 
(Eq (a, b, c, d, e, f, g), Show (a, b, c, d, e, f, g), Typeable (a, b, c, d, e, f, g), Show (Size (a, b, c, d, e, f, g)), Lattice (Size (a, b, c, d, e, f, g)), Type a, Type b, Type c, Type d, Type e, Type f, Type g) => Type (a, b, c, d, e, f, g) 

Sized types

type family Size a Source

data RangeSet a whereSource

A generalization of Range that serves two purposes: (1) Adding an extra Universal constructor to support unbounded types (Range can only represent bounded ranges), and (2) pack a BoundedInt constraint with the RangeSet constructor. This is what allows sizeToRange to be defined as a total function with Type as the only constraint.

Constructors

RangeSet :: BoundedInt a => Range a -> RangeSet a 
Universal :: RangeSet a 

sizeToRange :: forall a. Type a => Size a -> RangeSet aSource

Cast a Size to a RangeSet

tArr :: Patch a a -> Patch [a] [a]Source