netwire-5.0.1: Functional reactive programming library

Copyright(c) 2013 Ertugrul Soeylemez
LicenseBSD3
MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Wire.Session

Contents

Description

 

Synopsis

State delta types

class (Monoid s, Real t) => HasTime t s | s -> t where Source

State delta types with time deltas.

Methods

dtime :: s -> t Source

Extract the current time delta.

Instances

(Monoid s, Real t) => HasTime t (Timed t s) 

newtype Session m 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

stepSession :: m (s, Session m s)
 

Instances

Wires with time

data Timed t s Source

This state delta type denotes time deltas. This is necessary for most FRP applications.

Constructors

Timed t s 

Instances

(Monoid s, Real t) => HasTime t (Timed t s) 
Functor (Timed t) 
Foldable (Timed t) 
Traversable (Timed t) 
(Eq t, Eq s) => Eq (Timed t s) 
(Data t, Data s) => Data (Timed t s) 
(Ord t, Ord s) => Ord (Timed t s) 
(Read t, Read s) => Read (Timed t s) 
(Show t, Show s) => Show (Timed t s) 
(Monoid s, Num t) => Monoid (Timed t s) 
Typeable (* -> * -> *) Timed 

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.

countSession Source

Arguments

:: 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.