Copyright | (c) 2013 Ertugrul Soeylemez |
---|---|
License | BSD3 |
Maintainer | Ertugrul Soeylemez <[email protected]> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Control.Wire.Session
Contents
Description
Synopsis
- class (Monoid s, Real t) => HasTime t s | s -> t where
- dtime :: s -> t
- newtype Session (m :: Type -> Type) s = Session {
- stepSession :: m (s, Session m s)
- data Timed t s = Timed t s
- clockSession :: forall (m :: Type -> Type) s. MonadIO m => Session m (s -> Timed NominalDiffTime s)
- clockSession_ :: forall (m :: Type -> Type). (Applicative m, MonadIO m) => Session m (Timed NominalDiffTime ())
- countSession :: forall (m :: Type -> Type) t s. Applicative m => t -> Session m (s -> Timed t s)
- countSession_ :: forall (m :: Type -> Type) t. Applicative m => t -> Session m (Timed t ())
State delta types
newtype Session (m :: Type -> Type) s Source #
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.
Constructors
Session | |
Fields
|
Instances
Applicative m => Applicative (Session m) Source # | |
Functor m => Functor (Session m) Source # | |
Wires with time
This state delta type denotes time deltas. This is necessary for most FRP applications.
Constructors
Timed t s |
Instances
(Semigroup s, Monoid s, Real t) => HasTime t (Timed t s) Source # | |
Defined in Control.Wire.Session | |
Foldable (Timed t) Source # | |
Defined in Control.Wire.Session Methods fold :: Monoid m => Timed t m -> m # foldMap :: Monoid m => (a -> m) -> Timed t a -> m # foldMap' :: Monoid m => (a -> m) -> Timed t a -> m # foldr :: (a -> b -> b) -> b -> Timed t a -> b # foldr' :: (a -> b -> b) -> b -> Timed t a -> b # foldl :: (b -> a -> b) -> b -> Timed t a -> b # foldl' :: (b -> a -> b) -> b -> Timed t a -> b # foldr1 :: (a -> a -> a) -> Timed t a -> a # foldl1 :: (a -> a -> a) -> Timed t a -> a # elem :: Eq a => a -> Timed t a -> Bool # maximum :: Ord a => Timed t a -> a # minimum :: Ord a => Timed t a -> a # | |
Traversable (Timed t) Source # | |
Functor (Timed t) Source # | |
(Data t, Data s) => Data (Timed t s) Source # | |
Defined in Control.Wire.Session Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Timed t s -> c (Timed t s) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Timed t s) # toConstr :: Timed t s -> Constr # dataTypeOf :: Timed t s -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Timed t s)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Timed t s)) # gmapT :: (forall b. Data b => b -> b) -> Timed t s -> Timed t s # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Timed t s -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Timed t s -> r # gmapQ :: (forall d. Data d => d -> u) -> Timed t s -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Timed t s -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Timed t s -> m (Timed t s) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Timed t s -> m (Timed t s) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Timed t s -> m (Timed t s) # | |
(Semigroup s, Monoid s, Num t) => Monoid (Timed t s) Source # | |
(Semigroup s, Num t) => Semigroup (Timed t s) Source # | |
(Read t, Read s) => Read (Timed t s) Source # | |
(Show t, Show s) => Show (Timed t s) Source # | |
(Eq t, Eq s) => Eq (Timed t s) Source # | |
(Ord t, Ord s) => Ord (Timed t s) Source # | |
clockSession :: forall (m :: Type -> Type) s. MonadIO m => Session m (s -> Timed NominalDiffTime s) Source #
State delta generator for a real time clock.
clockSession_ :: forall (m :: Type -> Type). (Applicative m, MonadIO m) => Session m (Timed NominalDiffTime ()) Source #
Non-extending version of clockSession
.
Arguments
:: forall (m :: Type -> Type) t s. 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_ :: forall (m :: Type -> Type) t. Applicative m => t -> Session m (Timed t ()) Source #
Non-extending version of countSession
.