on master help sign in
Change foldp example to contain a function which uses both of its arguments
commitfa28e6119848e5eff3562652e0c2edfcec04ce42 authorZsombor Nagy <zsombor@nagy.com> dateThu 8 Aug 2013, 08:24 (13 years ago) parent4d719eb
1 file changed+2−1
libraries/Signal.elm+2−1
libraries/Signal.elm+2−1
@@ -52,7 +52,8 @@ lift8 = Native.Signal.lift8
5252-- Create a past-dependent signal. Each value given on the input signal will
5353-- be accumulated, producing a new output value.
5454--
55−-- For instance, `(foldp (\\t acc -> acc + 1) 0 (Time.every second))` increments every second.
55+-- For instance, `(foldp (\\arrows number -> number + arrows.y) 0 Keyboard.arrows)`
56+-- increments or decrements the accumulated value (which starts at zero) when the up or down arrow keys are pressed.
5657foldp : (a -> b -> b) -> b -> Signal a -> Signal b
5758foldp = Native.Signal.foldp
5859