@@ -3,7 +3,7 @@
3-- working with time (e.g. setting FPS) and combining signals and time (e.g.
3-- working with time (e.g. setting FPS) and combining signals and time (e.g.
4-- delaying updates, getting timestamps) can be found in the
4-- delaying updates, getting timestamps) can be found in the
5-- [`Time`](/docs/Signal/Time.elm) library.
5-- [`Time`](/docs/Signal/Time.elm) library.
7-- Note: There are lift functions up to `lift8`.
7-- Note: There are lift functions up to `lift8`.
8module Signal where
8module Signal where
@@ -29,7 +29,7 @@ lift8 : (a -> b -> c -> d -> e -> f -> g -> h -> i) -> Signal a -> Signal b -> S
30-- Create a past-dependent signal. Each value given on the input signal will
30-- Create a past-dependent signal. Each value given on the input signal will
31-- be accumulated, producing a new output value.
31-- be accumulated, producing a new output value.
33-- For instance, `(foldp (\\t acc -> acc + 1) 0 (Time.every second))` increments every second.
33-- For instance, `(foldp (\\t acc -> acc + 1) 0 (Time.every second))` increments every second.
34foldp : (a -> b -> b) -> b -> Signal a -> Signal b
34foldp : (a -> b -> b) -> b -> Signal a -> Signal b
@@ -41,6 +41,7 @@ merge : Signal a -> Signal a -> Signal a
41-- signals update simultaneously.
41-- signals update simultaneously.
42merges : [Signal a] -> Signal a
42merges : [Signal a] -> Signal a
44+-- Combine many signals into one, with an array of results.
44combine : [Signal a] -> Signal [a]
45combine : [Signal a] -> Signal [a]
45combine = L.foldr (S.lift2 (::)) (S.constant [])
46combine = L.foldr (S.lift2 (::)) (S.constant [])
@@ -104,9 +105,9 @@ delay : Time -> Signal a -> Signal a
105-- Signal application. This takes two signals, holding a function and
106-- Signal application. This takes two signals, holding a function and
106-- a value. It applies the current function to the current value.
107-- a value. It applies the current function to the current value.
108-- So the following expressions are equivalent:
109-- So the following expressions are equivalent:
110-- scene <~ Mouse.x ~ Mouse.y
111-- scene <~ Mouse.x ~ Mouse.y
111-- lift2 scene Mouse.x Mouse.y
112-- lift2 scene Mouse.x Mouse.y
112(~) : Signal (a -> b) -> Signal a -> Signal b
113(~) : Signal (a -> b) -> Signal a -> Signal b