Safe Haskell | None |
---|
- module SimpleH.Reactive.Time
- module SimpleH.Reactive.TimeVal
- data Event t a
- _event :: Iso (Event t a) (Event t' b) [Future t a] [Future t' b]
- atTimes :: Unit f => [a] -> Event (f a) ()
- withTime :: Ord t => Event t a -> Event t (TimeVal t, a)
- times :: Ord t => Event t a -> Event t (TimeVal t)
- mapFutures :: (Future t' b -> Future t a) -> Event t' b -> Event t a
- (//) :: Ord t => Event t a -> Event t b -> Event t (a, Event t b)
- (<|*>) :: Ord t => Event t (a -> b) -> (a, Event t a) -> Event t b
- groupE :: (Eq s, Ord t) => Event t s -> Event t [Future t s]
- mask :: (Bounded t, Ord t) => Event t Bool -> Event t b -> Event t b
- sink :: Event Seconds (IO b) -> IO ()
- event :: IO a -> IO (Event Seconds a)
- data Future t a
- _future :: Iso (Future t a) (Future t' b) (Time t, a) (Time t', b)
- _time :: Lens (Time t) (Time t') (Future t a) (Future t' a)
- _value :: Lens a b (Future t a) (Future t b)
- futureIO :: IO a -> IO (Future Seconds a)
Documentation
module SimpleH.Reactive.Time
module SimpleH.Reactive.TimeVal
Reactive Events
An event (a list of time-value pairs of increasing times)
Contructing events
Combining events
(//) :: Ord t => Event t a -> Event t b -> Event t (a, Event t b)Source
The 'splice' operator. Occurs when a
occurs.
at t: a // b = (a,before t: b)
(<|*>) :: Ord t => Event t (a -> b) -> (a, Event t a) -> Event t bSource
The 'over' operator. Occurs only when a
occurs.
at t: a <|*> (bi,b) = a <*> (minBound,bi):b
Filtering events
groupE :: (Eq s, Ord t) => Event t s -> Event t [Future t s]Source
Group the occurences of an event by equality. Occurs when the first occurence of a group occurs.
Real-world event synchronization
sink :: Event Seconds (IO b) -> IO ()Source
Sinks an action event into the Real World. Each action is executed
Future values
A Future value (a value with a timestamp)
Ord t => Unit (Future t) | |
Ord t => Monad (Future t) | |
Ord t => Applicative (Future t) | |
Functor (Future t) | |
Foldable (Future t) | |
Traversable (Future t) | |
Ord t => Eq (Future t a) | |
Ord t => Ord (Future t a) | |
(Eq t, Show t, Show a) => Show (Future t a) | |
(Ord t, Monoid a) => Monoid (Future t a) | |
(Ord t, Semigroup a) => Semigroup (Future t a) |