| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
FRP.Rhine.Reactimation.Tick
Synopsis
- data Tickable m cla clb cl clc cld a b c d = Tickable {
- buffer1 :: ResamplingBuffer m cla clb a b
- ticksf :: SF m cl b c
- buffer2 :: ResamplingBuffer m clc cld c d
- parClockInL :: ParClockInclusion (Leftmost cl) clb
- parClockInR :: ParClockInclusion (Rightmost cl) clc
- lastTime :: LastTime cl
- initTime :: TimeDomainOf cl
- initLastTime :: SF m cl a b -> TimeDomainOf cl -> LastTime cl
- createTickable :: ResamplingBuffer m cla (Leftmost cl) a b -> SF m cl b c -> ResamplingBuffer m (Rightmost cl) cld c d -> TimeDomainOf cl -> Tickable m cla (Leftmost cl) cl (Rightmost cl) cld a b c d
- tick :: (Monad m, Clock m cl, TimeDomainOf cla ~ TimeDomainOf cl, TimeDomainOf clb ~ TimeDomainOf cl, TimeDomainOf clc ~ TimeDomainOf cl, TimeDomainOf cld ~ TimeDomainOf cl, TimeDomainOf (Leftmost cl) ~ TimeDomainOf cl, TimeDomainOf (Rightmost cl) ~ TimeDomainOf cl) => Tickable m cla clb cl clc cld a b c d -> TimeDomainOf cl -> Tag cl -> m (Tickable m cla clb cl clc cld a b c d)
- trivialResamplingBuffer :: Monad m => cl -> ResamplingBuffer m (Rightmost cl) (Leftmost cl) () ()
Documentation
data Tickable m cla clb cl clc cld a b c d Source #
A signal function (SF) enclosed by matching ResamplingBuffers and further auxiliary data,
such that it can be stepped with each arriving tick from a clock cl.
They play a similar role like ReactHandles in dunai.
The type parameters:
m: The monad in which theSFand theResamplingBuffers produce side effectscla: The (irrelevant) input clock of the leftResamplingBufferclb: The clock at which the leftResamplingBufferproduces outputcl: The clock at which theSFticksclc: The clock at which the rightResamplingBufferaccepts inputcld: The (irrelevant) output clock of the rightResamplingBuffera: The (irrelevant) input type of the leftResamplingBufferb: The input type of theSFc: The output type of theSFd: The (irrelevant) output type of the rightResamplingBuffer
Constructors
| Tickable | |
Fields
| |
initLastTime :: SF m cl a b -> TimeDomainOf cl -> LastTime cl Source #
Initialise the tree of last tick times.
createTickable :: ResamplingBuffer m cla (Leftmost cl) a b -> SF m cl b c -> ResamplingBuffer m (Rightmost cl) cld c d -> TimeDomainOf cl -> Tickable m cla (Leftmost cl) cl (Rightmost cl) cld a b c d Source #
Initialise a Tickable from a signal function,
two matching enclosing resampling buffers and an initial time.
Arguments
| :: (Monad m, Clock m cl, TimeDomainOf cla ~ TimeDomainOf cl, TimeDomainOf clb ~ TimeDomainOf cl, TimeDomainOf clc ~ TimeDomainOf cl, TimeDomainOf cld ~ TimeDomainOf cl, TimeDomainOf (Leftmost cl) ~ TimeDomainOf cl, TimeDomainOf (Rightmost cl) ~ TimeDomainOf cl) | |
| => Tickable m cla clb cl clc cld a b c d | |
| -> TimeDomainOf cl | Timestamp of the present tick |
| -> Tag cl |
|
| -> m (Tickable m cla clb cl clc cld a b c d) |
In this function, one tick, or step of an asynchronous signal function happens.
The TimeInfo holds the information which part of the signal tree will tick.
This information is encoded in the Tag of the TimeInfo,
which is of type 'Either tag1 tag2' in case of a SequentialClock or a ParallelClock,
encoding either a tick for the left clock or the right clock.
trivialResamplingBuffer :: Monad m => cl -> ResamplingBuffer m (Rightmost cl) (Leftmost cl) () () Source #
A ResamplingBuffer producing only units.
(Slightly more efficient and direct implementation than the one in Timeless
that additionally unifies the clock types in a way needed for the tick implementation.)