frpnow-0.1: Principled practical FRP

Copyright(c) Atze van der Ploeg 2015
LicenseBSD-style
Maintaineratzeus@gmail.org
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Control.FRPNow.Time

Description

Various utility functions for FRPNow related to the passing of time. All take a "clock" as an argument, i.e. a behavior that gives the seconds since the program started.

The clock itself is created by a function specialized to the GUI library you are using FRP with such as getClock

Synopsis

Documentation

localTime :: (Floating time, Ord time) => Behavior time -> Behavior (Behavior time) Source

When sampled at time t, gives the time since time t

timeFrac :: (Floating time, Ord time) => Behavior time -> time -> Behavior (Behavior time) Source

Gives a behavior that linearly increases from 0 to 1 in the specified duration

lastInputs Source

Arguments

:: (Floating time, Ord time) 
=> Behavior time

The "clock" behavior, the behavior monotonically increases with time

-> time

The duration of the history to be kept

-> EvStream a

The input stream

-> Behavior (Behavior [a]) 

Gives a behavior containing the values of the events in the stream that occured in the last n seconds

bufferBehavior Source

Arguments

:: (Floating time, Ord time) 
=> Behavior time

The "clock" behavior, the behavior monotonically increases with time

-> time

The duration of the history to be kept

-> Behavior a

The input behavior

-> Behavior (Behavior [(time, a)]) 

Gives a behavior containing the values of the behavior during the last n seconds, with time stamps

delayBy Source

Arguments

:: (Floating time, Ord time) 
=> Behavior time

The "clock" behavior, the behavior monotonically increases with time

-> time

The duration of the delay

-> Behavior a

The input behavior

-> Behavior (Behavior a) 

Give a version of the behavior delayed by n seconds

delayByN Source

Arguments

:: (Floating time, Ord time) 
=> Behavior time

The "clock" behavior, the behavior monotonically increases with time

-> time

The duration _between_ delayed versions

-> Integer

The number of delayed versions

-> Behavior a

The input behavior

-> Behavior (Behavior [a]) 

Give n delayed versions of the behavior, each with the given duration in delay between them.