helm-0.7.0: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Signal

Contents

Synopsis

Documentation

newtype Signal a Source

Constructors

Signal 

Instances

Functor Signal 
Applicative Signal 

Composing

constant :: a -> Signal aSource

Creates a signal that never changes.

combine :: [Signal a] -> Signal [a]Source

Combines a list of signals into a signal of lists.

lift :: (a -> b) -> Signal a -> Signal bSource

Applies a function to a signal producing a new signal. This is a synonym of fmap. It automatically binds the input signal out of the signal generator.

 lift render Window.dimensions

lift2 :: (a -> b -> c) -> Signal a -> Signal b -> Signal cSource

Applies a function to two signals.

lift3 :: (a -> b -> c -> d) -> Signal a -> Signal b -> Signal c -> Signal dSource

Applies a function to three signals.

(<~) :: (a -> b) -> Signal a -> Signal bSource

An alias for lift.

(~~) :: Signal (a -> b) -> Signal a -> Signal bSource

Applies a function within a signal to a signal. This is a synonym of *. It automatically binds the input signal out of the signal generator.

 render <~ Window.dimensions ~~ Window.position

Accumulating

foldp :: (a -> b -> b) -> b -> Signal a -> Signal bSource

Creates a past-dependent signal that depends on another signal. This is a wrapper around the transfer function that automatically binds the input signal out of the signal generator. This function is useful for making a render function that depends on some accumulated state.

count :: Signal a -> Signal IntSource

Count the number of events that have occurred.

countIf :: (a -> Bool) -> Signal a -> Signal IntSource

Count the number of events that have occurred that satisfy a given predicate.

DYEL?

lift4 :: (a -> b -> c -> d -> e) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal eSource

Applies a function to four signals.

lift5 :: (a -> b -> c -> d -> e -> f) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal fSource

Applies a function to five signals.

lift6 :: (a -> b -> c -> d -> e -> f -> g) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal f -> Signal gSource

Applies a function to six signals.

lift7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal f -> Signal g -> Signal hSource

Applies a function to seven signals.

lift8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal f -> Signal g -> Signal h -> Signal iSource

Applies a function to eight signals.