tcalculus-1.0.0: A DSL prototype for structured realtime/reactive functional programing

Copyright(c) David Janin, 2016
Licensesee the LICENSE file in the distribution
Maintainerjanin@labri.fr
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Tile.TCategories

Contents

Description

Haskell instances of the categorical properties of duration or delay preserving function over tiles, using the various packages Control.Category.* by Edward Kmett.

Synopsis

Category instances

newtype FuncT d iv v1 v2 Source #

The category of functions over tiles

Constructors

FuncT (Tile d iv v1 -> Tile d iv v2) 

Instances

Category * (FuncT d iv) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

newtype FuncDurP d iv v1 v2 Source #

The category of duration preserving functions over tiles. A tile function is a duration preserving tile function when

durationT t == durationT (f t)

Constructors

FuncDurP (Tile d iv v1 -> Tile d iv v2) 

Instances

(Eq d, Num d, Lattice d) => PFunctor Either (FuncDurP d iv) (FuncDurP d iv) Source # 

Methods

first :: FuncDurP d iv a b -> FuncDurP d iv (Either a c) (Either b c) #

(Eq d, Num d, Lattice d) => QFunctor Either (FuncDurP d iv) (FuncDurP d iv) Source # 

Methods

second :: FuncDurP d iv a b -> FuncDurP d iv (Either c a) (Either c b) #

(Eq d, Num d, Lattice d) => Bifunctor Either (FuncDurP d iv) (FuncDurP d iv) (FuncDurP d iv) Source # 

Methods

bimap :: FuncDurP d iv a b -> FuncDurP d iv c d -> FuncDurP d iv (Either a c) (Either b d) #

Category * (FuncDurP d iv) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

(Eq d, Num d, Lattice d) => CCC (FuncDurP d iv) Source # 

Associated Types

type Exp (FuncDurP d iv :: * -> * -> *) :: * -> * -> * #

Methods

apply :: FuncDurP d iv (Product (FuncDurP d iv) (Exp (FuncDurP d iv) a b) a) b #

curry :: FuncDurP d iv (Product (FuncDurP d iv) a b) c -> FuncDurP d iv a (Exp (FuncDurP d iv) b c) #

uncurry :: FuncDurP d iv a (Exp (FuncDurP d iv) b c) -> FuncDurP d iv (Product (FuncDurP d iv) a b) c #

(Eq d, Num d, Lattice d) => Cartesian (FuncDurP d iv) Source # 

Associated Types

type Product (FuncDurP d iv :: * -> * -> *) :: * -> * -> * #

Methods

fst :: FuncDurP d iv (Product (FuncDurP d iv) a b) a #

snd :: FuncDurP d iv (Product (FuncDurP d iv) a b) b #

diag :: FuncDurP d iv a (Product (FuncDurP d iv) a a) #

(&&&) :: FuncDurP d iv a b -> FuncDurP d iv a c -> FuncDurP d iv a (Product (FuncDurP d iv) b c) #

(Eq d, Num d, Lattice d) => Braided (FuncDurP d iv) Either Source # 

Methods

braid :: FuncDurP d iv (Either a b) (Either b a) #

(Eq d, Num d, Lattice d) => Symmetric (FuncDurP d iv) Either Source # 
(Eq d, Num d, Lattice d) => Monoidal (FuncDurP d iv) Either Source # 

Associated Types

type Id (FuncDurP d iv :: * -> * -> *) (Either :: * -> * -> *) :: * #

Methods

idl :: FuncDurP d iv (Either (Id (FuncDurP d iv) Either) a) a #

idr :: FuncDurP d iv (Either a (Id (FuncDurP d iv) Either)) a #

coidl :: FuncDurP d iv a (Either (Id (FuncDurP d iv) Either) a) #

coidr :: FuncDurP d iv a (Either a (Id (FuncDurP d iv) Either)) #

(Eq d, Num d, Lattice d) => Associative (FuncDurP d iv) Either Source # 

Methods

associate :: FuncDurP d iv (Either (Either a b) c) (Either a (Either b c)) #

disassociate :: FuncDurP d iv (Either a (Either b c)) (Either (Either a b) c) #

(Eq d, Fractional d, Lattice d) => Fractional (FuncDurP d iv v1 v2) Source # 

Methods

(/) :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

recip :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

fromRational :: Rational -> FuncDurP d iv v1 v2 #

(Eq d, Num d, Lattice d) => Num (FuncDurP d iv v1 v2) Source # 

Methods

(+) :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

(-) :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

(*) :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

negate :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

abs :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

signum :: FuncDurP d iv v1 v2 -> FuncDurP d iv v1 v2 #

fromInteger :: Integer -> FuncDurP d iv v1 v2 #

type Exp (FuncDurP d iv) Source # 
type Exp (FuncDurP d iv) = FuncDurP d iv
type Product (FuncDurP d iv) Source # 
type Product (FuncDurP d iv) = Either
type Id (FuncDurP d iv) Either Source # 
type Id (FuncDurP d iv) Either = Void

toFuncDurP :: (Eq d, Num d, Lattice d, POrd v1) => Functile d iv v1 v2 -> FuncDurP d iv v1 v2 Source #

Lifts any function over tiles to a duration preserving function over tiles.

newtype FuncDelayP d iv v1 v2 Source #

The category of delay preserving functions over tiles. A tile function is a delay preserving tile function when

f (delayT t) == delayT (f t)

Constructors

FuncDelayP (Tile d iv v1 -> Tile d iv v2) 

Instances

(Eq d, Num d, Lattice d) => PFunctor Either (FuncDelayP d iv) (FuncDelayP d iv) Source # 

Methods

first :: FuncDelayP d iv a b -> FuncDelayP d iv (Either a c) (Either b c) #

(Eq d, Num d, Lattice d) => QFunctor Either (FuncDelayP d iv) (FuncDelayP d iv) Source # 

Methods

second :: FuncDelayP d iv a b -> FuncDelayP d iv (Either c a) (Either c b) #

(Eq d, Num d, Lattice d) => Bifunctor Either (FuncDelayP d iv) (FuncDelayP d iv) (FuncDelayP d iv) Source # 

Methods

bimap :: FuncDelayP d iv a b -> FuncDelayP d iv c d -> FuncDelayP d iv (Either a c) (Either b d) #

Category * (FuncDelayP d iv) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

(Eq d, Num d, Lattice d) => Cartesian (FuncDelayP d iv) Source # 

Associated Types

type Product (FuncDelayP d iv :: * -> * -> *) :: * -> * -> * #

Methods

fst :: FuncDelayP d iv (Product (FuncDelayP d iv) a b) a #

snd :: FuncDelayP d iv (Product (FuncDelayP d iv) a b) b #

diag :: FuncDelayP d iv a (Product (FuncDelayP d iv) a a) #

(&&&) :: FuncDelayP d iv a b -> FuncDelayP d iv a c -> FuncDelayP d iv a (Product (FuncDelayP d iv) b c) #

(Eq d, Num d, Lattice d) => CoCartesian (FuncDelayP d iv) Source # 

Associated Types

type Sum (FuncDelayP d iv :: * -> * -> *) :: * -> * -> * #

Methods

inl :: FuncDelayP d iv a (Sum (FuncDelayP d iv) a b) #

inr :: FuncDelayP d iv b (Sum (FuncDelayP d iv) a b) #

codiag :: FuncDelayP d iv (Sum (FuncDelayP d iv) a a) a #

(|||) :: FuncDelayP d iv a c -> FuncDelayP d iv b c -> FuncDelayP d iv (Sum (FuncDelayP d iv) a b) c #

(Eq d, Num d, Lattice d) => Braided (FuncDelayP d iv) Either Source # 

Methods

braid :: FuncDelayP d iv (Either a b) (Either b a) #

(Eq d, Num d, Lattice d) => Symmetric (FuncDelayP d iv) Either Source # 
(Eq d, Num d, Lattice d) => Monoidal (FuncDelayP d iv) Either Source # 

Associated Types

type Id (FuncDelayP d iv :: * -> * -> *) (Either :: * -> * -> *) :: * #

Methods

idl :: FuncDelayP d iv (Either (Id (FuncDelayP d iv) Either) a) a #

idr :: FuncDelayP d iv (Either a (Id (FuncDelayP d iv) Either)) a #

coidl :: FuncDelayP d iv a (Either (Id (FuncDelayP d iv) Either) a) #

coidr :: FuncDelayP d iv a (Either a (Id (FuncDelayP d iv) Either)) #

(Eq d, Num d, Lattice d) => Associative (FuncDelayP d iv) Either Source # 

Methods

associate :: FuncDelayP d iv (Either (Either a b) c) (Either a (Either b c)) #

disassociate :: FuncDelayP d iv (Either a (Either b c)) (Either (Either a b) c) #

(Eq d, Fractional d, Lattice d) => Fractional (FuncDelayP d iv v1 v2) Source # 

Methods

(/) :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

recip :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

fromRational :: Rational -> FuncDelayP d iv v1 v2 #

(Eq d, Num d, Lattice d) => Num (FuncDelayP d iv v1 v2) Source # 

Methods

(+) :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

(-) :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

(*) :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

negate :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

abs :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

signum :: FuncDelayP d iv v1 v2 -> FuncDelayP d iv v1 v2 #

fromInteger :: Integer -> FuncDelayP d iv v1 v2 #

type Product (FuncDelayP d iv) Source # 
type Product (FuncDelayP d iv) = Either
type Sum (FuncDelayP d iv) Source # 
type Sum (FuncDelayP d iv) = Either
type Id (FuncDelayP d iv) Either Source # 
type Id (FuncDelayP d iv) Either = Void

toFuncDelayP :: (Eq d, Num d, Lattice d, POrd v1) => Functile d iv v1 v2 -> FuncDelayP d iv v1 v2 Source #

Lifts any function over tiles to a delay preserving function over tiles.