Safe Haskell | None |
---|---|
Language | Haskell2010 |
In the Rhine philosophy, _event sources are clocks_. Often, we want to extract certain subevents from event sources, e.g. single out only left mouse button clicks from all input device events. This module provides a general purpose selection clock that ticks only on certain subevents.
Synopsis
- data SelectClock cl a = SelectClock {}
- schedSelectClocks :: (Monad m, Semigroup cl, Clock m cl) => Schedule m (SelectClock cl a) (SelectClock cl b)
- schedSelectClockAndMain :: (Monad m, Semigroup cl, Clock m cl) => Schedule m cl (SelectClock cl a)
- filterS :: Monad m => MSF m () (Maybe b) -> MSF m () b
Documentation
data SelectClock cl a Source #
A clock that selects certain subevents of type a
,
from the tag of a main clock.
If two SelectClock
s would tick on the same type of subevents,
but should not have the same type,
one should newtype
the subevent.
Instances
(Monad m, Clock m cl) => Clock m (SelectClock cl a) Source # | |
Defined in FRP.Rhine.Clock.Select type Time (SelectClock cl a) :: Type Source # type Tag (SelectClock cl a) :: Type Source # initClock :: SelectClock cl a -> RunningClockInit m (Time (SelectClock cl a)) (Tag (SelectClock cl a)) Source # | |
type Time (SelectClock cl a) Source # | |
Defined in FRP.Rhine.Clock.Select | |
type Tag (SelectClock cl a) Source # | |
Defined in FRP.Rhine.Clock.Select |
schedSelectClocks :: (Monad m, Semigroup cl, Clock m cl) => Schedule m (SelectClock cl a) (SelectClock cl b) Source #
A universal schedule for two subclocks of the same main clock.
The main clock must be a Semigroup
(e.g. a singleton).
schedSelectClockAndMain :: (Monad m, Semigroup cl, Clock m cl) => Schedule m cl (SelectClock cl a) Source #
A universal schedule for a subclock and its main clock.