Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type ClSF m cl a b = Automaton (ReaderT (TimeInfo cl) m) a b
- type ClSignal m cl a = forall arbitrary. ClSF m cl arbitrary a
- type Behaviour m time a = forall cl. time ~ Time cl => ClSignal m cl a
- type Behavior m time a = Behaviour m time a
- type BehaviourF m time a b = forall cl. time ~ Time cl => ClSF m cl a b
- type BehaviorF m time a b = BehaviourF m time a b
- mapMaybe :: Monad m => ClSF m cl a b -> ClSF m cl (Maybe a) (Maybe b)
- hoistClSF :: (Monad m1, Monad m2) => (forall c. m1 c -> m2 c) -> ClSF m1 cl a b -> ClSF m2 cl a b
- hoistClSFAndClock :: (Monad m1, Monad m2) => (forall c. m1 c -> m2 c) -> ClSF m1 cl a b -> ClSF m2 (HoistClock m1 m2 cl) a b
- liftClSF :: (Monad m, MonadTrans t, Monad (t m)) => ClSF m cl a b -> ClSF (t m) cl a b
- liftClSFAndClock :: (Monad m, MonadTrans t, Monad (t m)) => ClSF m cl a b -> ClSF (t m) (LiftClock m t cl) a b
- timeless :: Monad m => Automaton m a b -> ClSF m cl a b
- arrMCl :: Monad m => (a -> m b) -> ClSF m cl a b
- constMCl :: Monad m => m b -> ClSF m cl a b
- module Control.Arrow
- module Data.Automaton
Documentation
type ClSF m cl a b = Automaton (ReaderT (TimeInfo cl) m) a b Source #
A (synchronous, clocked) automaton
with the additional side effect of being time-aware,
that is, reading the current TimeInfo
of the clock cl
.
type ClSignal m cl a = forall arbitrary. ClSF m cl arbitrary a Source #
A clocked signal is a ClSF
with no input required.
It produces its output on its own.
type Behaviour m time a = forall cl. time ~ Time cl => ClSignal m cl a Source #
A (side-effectful) behaviour is a time-aware stream
that doesn't depend on a particular clock.
time
denotes the TimeDomain
.
type BehaviourF m time a b = forall cl. time ~ Time cl => ClSF m cl a b Source #
A (side-effectful) behaviour function is a time-aware synchronous stream
function that doesn't depend on a particular clock.
time
denotes the TimeDomain
.
type BehaviorF m time a b = BehaviourF m time a b Source #
Compatibility to U.S. american spelling.
mapMaybe :: Monad m => ClSF m cl a b -> ClSF m cl (Maybe a) (Maybe b) Source #
Call a ClSF
every time the input is 'Just a'.
Caution: This will not change the time differences since the last tick.
For example,
while integrate 1
is approximately the same as timeInfoOf sinceInit
,
mapMaybe $ integrate 1
is very different from
mapMaybe $ timeInfoOf sinceInit
.
The former only integrates when the input is Just 1
,
whereas the latter always returns the correct time since initialisation.
hoistClSF :: (Monad m1, Monad m2) => (forall c. m1 c -> m2 c) -> ClSF m1 cl a b -> ClSF m2 cl a b Source #
Hoist a ClSF
along a monad morphism.
hoistClSFAndClock :: (Monad m1, Monad m2) => (forall c. m1 c -> m2 c) -> ClSF m1 cl a b -> ClSF m2 (HoistClock m1 m2 cl) a b Source #
Hoist a ClSF
and its clock along a monad morphism.
liftClSF :: (Monad m, MonadTrans t, Monad (t m)) => ClSF m cl a b -> ClSF (t m) cl a b Source #
Lift a ClSF
into a monad transformer.
liftClSFAndClock :: (Monad m, MonadTrans t, Monad (t m)) => ClSF m cl a b -> ClSF (t m) (LiftClock m t cl) a b Source #
Lift a ClSF
and its clock into a monad transformer.
timeless :: Monad m => Automaton m a b -> ClSF m cl a b Source #
An automaton without dependency on time
is a ClSF
for any clock.
arrMCl :: Monad m => (a -> m b) -> ClSF m cl a b Source #
Utility to lift Kleisli arrows directly to ClSF
s.
module Control.Arrow
module Data.Automaton