repa-scalar-4.2.1.1: Scalar data types and conversions.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Scalar.Product

Contents

Synopsis

Product type

data a :*: b infixr 9 Source

A strict product type, written infix.

Constructors

!a :*: !b infixr 9 

Instances

(Unbox a, Unbox b) => Vector Vector ((:*:) a b) Source 
(Unbox a, Unbox b) => MVector MVector ((:*:) a b) Source 
IsProdList ts => Discard Z ((:*:) t1 ts) Source 
IsProdList ts => Select Z ((:*:) t1 ts) Source 
Discard n ts => Discard (S n) ((:*:) t1 ts) Source 
Select n ts => Select (S n) ((:*:) t1 ts) Source 
(Eq a, Eq b) => Eq ((:*:) a b) Source 
(Show a, Show b) => Show ((:*:) a b) Source 
(Unbox a, Unbox b) => Unbox ((:*:) a b) Source 
(IsKeyValues p, IsKeyValues ps, (~) * (Keys p) (Keys ps)) => IsKeyValues ((:*:) p ps) Source 
IsProdList fs => IsProdList ((:*:) f fs) Source 
Mask ms ts => Mask ((:*:) Keep ms) ((:*:) t1 ts) Source 
Mask ms ts => Mask ((:*:) Drop ms) ((:*:) t1 ts) Source 
data MVector s ((:*:) a b) = MV_Prod !Int !(MVector s a) !(MVector s b) Source 
type Discard' Z ((:*:) t1 ts) = ts Source 
type Select' Z ((:*:) t1 ts) = t1 Source 
type Discard' (S n) ((:*:) t1 ts) = (:*:) t1 (Discard' n ts) Source 
type Select' (S n) ((:*:) t1 ts) = Select' n ts Source 
data Vector ((:*:) a b) = V_Prod !Int !(Vector a) !(Vector b) Source 
type Keys ((:*:) p ps) = Keys p Source 
type Values ((:*:) p ps) = (:*:) (Values p) (Values ps) Source 
type Mask' ((:*:) Keep ms) ((:*:) t1 ts) = (:*:) t1 (Mask' ms ts) Source 
type Mask' ((:*:) Drop ms) ((:*:) t1 ts) = Mask' ms ts Source 

class IsProdList p where Source

Sequences of products that form a valid list, using () for the nil value.

Methods

isProdList :: p -> Bool Source

Instances

class IsKeyValues p where Source

Sequences of products and tuples that form hetrogeneous key-value pairs.

Associated Types

type Keys p Source

type Values p Source

Methods

keys :: p -> [Keys p] Source

Get a cons-list of all the keys.

values :: p -> Values p Source

Get a heterogeneous product-list of all the values.

Instances

IsKeyValues (k, v) Source 
(IsKeyValues p, IsKeyValues ps, (~) * (Keys p) (Keys ps)) => IsKeyValues ((:*:) p ps) Source 

Selecting

class IsProdList t => Select n t where Source

Associated Types

type Select' n t Source

Methods

select :: Nat n -> t -> Select' n t Source

Return the element with this index from a product list.

Instances

IsProdList ts => Select Z ((:*:) t1 ts) Source 
Select n ts => Select (S n) ((:*:) t1 ts) Source 

Discarding

class IsProdList t => Discard n t where Source

Associated Types

type Discard' n t Source

Methods

discard :: Nat n -> t -> Discard' n t Source

Discard the element with this index from a product list.

Instances

IsProdList ts => Discard Z ((:*:) t1 ts) Source 
Discard n ts => Discard (S n) ((:*:) t1 ts) Source 

Masking

class (IsProdList m, IsProdList t) => Mask m t where Source

Class of data types that can have parts masked out.

Associated Types

type Mask' m t Source

Methods

mask :: m -> t -> Mask' m t Source

Mask out some component of a type.

mask (Keep :*: Drop  :*: Keep :*: ()) 
     (1    :*: "foo" :*: 'a'  :*: ())   =   (1 :*: 'a' :*: ())

mask (Drop :*: Drop  :*: Drop :*: ()) 
     (1    :*: "foo" :*: 'a'  :*: ())   =   ()

Instances

Mask () () Source 
Mask ms ts => Mask ((:*:) Keep ms) ((:*:) t1 ts) Source 
Mask ms ts => Mask ((:*:) Drop ms) ((:*:) t1 ts) Source 

data Keep Source

Singleton to indicate a field that should be kept.

Constructors

Keep 

Instances

Mask ms ts => Mask ((:*:) Keep ms) ((:*:) t1 ts) Source 
type Mask' ((:*:) Keep ms) ((:*:) t1 ts) = (:*:) t1 (Mask' ms ts) Source 

data Drop Source

Singleton to indicate a field that should be dropped.

Constructors

Drop 

Instances

Mask ms ts => Mask ((:*:) Drop ms) ((:*:) t1 ts) Source 
type Mask' ((:*:) Drop ms) ((:*:) t1 ts) = Mask' ms ts Source