Copyright | (c) 2013 Ertugrul Soeylemez (c) 2015 Rongcui Dong |
---|---|
License | BSD3 |
Maintainer | Rongcui Dong <karl_1702@188.com> |
Safe Haskell | Safe |
Language | Haskell2010 |
- class (Monoid s, Real t) => HasTime t s | s -> t where
- dtime :: s -> t
- newtype Session m s = Session {
- stepSession :: m (s, Session m s)
- data Timed t s = Timed t s
- clockSession :: MonadIO m => Session m (s -> Timed NominalDiffTime s)
- clockSession_ :: (Applicative m, MonadIO m) => Session m (Timed NominalDiffTime ())
- countSession :: Applicative m => t -> Session m (s -> Timed t s)
- countSession_ :: Applicative m => t -> Session m (Timed t ())
State delta types
class (Monoid s, Real t) => HasTime t s | s -> t where Source
State delta types with time deltas. You can extract fractionals
using realToFrac
State delta generators as required for wire sessions, most notably to generate time deltas. These are mini-wires with the sole purpose of generating these deltas.
Session | |
|
Functor m => Functor (Session m) Source | |
Applicative m => Applicative (Session m) Source |
Wires with time
This state delta type denotes time deltas. This is necessary for most FRP applications.
Timed t s |
(Monoid s, Real t) => HasTime t (Timed t s) Source | |
Functor (Timed t) Source | |
Foldable (Timed t) Source | |
Traversable (Timed t) Source | |
(Eq t, Eq s) => Eq (Timed t s) Source | |
(Data t, Data s) => Data (Timed t s) Source | |
(Ord t, Ord s) => Ord (Timed t s) Source | |
(Read t, Read s) => Read (Timed t s) Source | |
(Show t, Show s) => Show (Timed t s) Source | |
(Monoid s, Num t) => Monoid (Timed t s) Source |
clockSession :: MonadIO m => Session m (s -> Timed NominalDiffTime s) Source
State delta generator for a real time clock.
clockSession_ :: (Applicative m, MonadIO m) => Session m (Timed NominalDiffTime ()) Source
Non-extending version of clockSession
.
:: Applicative m | |
=> t | Increment size. |
-> Session m (s -> Timed t s) |
State delta generator for a simple counting clock. Denotes a fixed
framerate. This is likely more useful than clockSession
for
simulations and real-time games.
countSession_ :: Applicative m => t -> Session m (Timed t ()) Source
Non-extending version of countSession
.