rhine-0.4.0.4: Functional Reactive Programming with type-level clocks

Safe HaskellNone
LanguageHaskell2010

FRP.Rhine.Clock.Select

Synopsis

Documentation

data SelectClock cl a Source #

A clock that selects certain subevents of type a, from the tag of a main clock.

Constructors

SelectClock 

Fields

  • mainClock :: cl

    The main clock | Return Nothing if no tick of the subclock is required, or 'Just a' if the subclock should tick, with tag a.

  • select :: Tag cl -> Maybe a
     
Instances
(Monad m, Clock m cl) => Clock m (SelectClock cl a) Source # 
Instance details

Defined in FRP.Rhine.Clock.Select

Associated Types

type TimeDomainOf (SelectClock cl a) :: * Source #

type Tag (SelectClock cl a) :: * Source #

Methods

startClock :: SelectClock cl a -> m (MSF m () (TimeDomainOf (SelectClock cl a), Tag (SelectClock cl a)), TimeDomainOf (SelectClock cl a)) Source #

type TimeDomainOf (SelectClock cl a) Source # 
Instance details

Defined in FRP.Rhine.Clock.Select

type Tag (SelectClock cl a) Source # 
Instance details

Defined in FRP.Rhine.Clock.Select

type Tag (SelectClock cl a) = a

schedSelectClocks :: (Monad m, Monoid 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 monoid (e.g. a singleton).

filterS :: Monad m => MSF m () (Maybe b) -> MSF m () b Source #

Helper function that runs an MSF with Maybe output until it returns a value.