on master help sign in
Merge pull request #206 from zsombornagy/master

A hopefully better foldp example

commit27ee17962681f8780dbcea5a8e5f2bc0fc588b6b authorEvan Czaplicki <info@elm-lang.org> dateThu 8 Aug 2013, 13:53 (13 years ago) parent4d719ebfa28e61
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