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

Reactive.Event

Description

Temporal values arise from well bracketed events.

Synopsis

Documentation

data Event v Source #

Events of type v. A temporal value v is then a pair of event On v, Off v, that tells how much last the value v. The duration of an temporal value v is defined as the time elpased between the reception of event On v and teh event Off v.

A sequence of events over the value type v is well parenthesized, that is, for every value v:

  • every On v event (resp. Off v event) is necessarily followed (resp. preceeded) by an Off v event (resp. On v event),
  • two On v events (resp. Off v events) are necessarily separated by an Off v event (resp. an On v event).

Simultaneous events On v and Off v events denote a temporal value of duration 0 that is our encoding of classical (unpaired) events

Constructors

Start 
Off !v 
On !v 
Stop 

Instances

Functor Event Source # 

Methods

fmap :: (a -> b) -> Event a -> Event b #

(<$) :: a -> Event b -> Event a #

Eq v => Eq (Event v) Source # 

Methods

(==) :: Event v -> Event v -> Bool #

(/=) :: Event v -> Event v -> Bool #

Show v => Show (Event v) Source # 

Methods

showsPrec :: Int -> Event v -> ShowS #

show :: Event v -> String #

showList :: [Event v] -> ShowS #

eventsToQList :: (Eq d, Eq v, Num d, Lattice d) => [(d, Event v)] -> QList d iv v Source #

Converts a sequence of a timed sequence of On/Off events, starting with Start event and ending with a Stop event into a qlist. Essentially used for testing purposes.

eventsToTile :: (Eq d, Eq v, Num d, Lattice d) => [(d, Event v)] -> Tile d iv v Source #

Converts the resulting qlists into tiles (obsolete)

qListToEvents :: (Eq d, Num d, Ord d, Lattice d, Eq v, POrd v) => QList d iv v -> [(d, Event v)] Source #

Converts a qList into a sequence of a timed sequence of On/Off events. The sequence starts with a Start event and ends with a Stop event. Essentially used for testing purposes.

tileToEvents :: (Eq d, Num d, Ord d, Lattice d, Eq v, POrd v) => Tile d iv v -> [(d, Event v)] Source #

Converts a tile into a sequence of a timed sequence of On/Off events. The sequence starts with a Start event and ends with a Stop event. All anticipation (atoms before the input root) are droped.

filterEvent :: Ord v => Weight v -> [Event v] -> (Weight v, [Event v]) Source #

Filters On and Off events to ensure they are well parenthesized

emptyWeight :: Weight v Source #

initial Weight value