]> gitweb.factorcode.org Git - factor.git/blob - extra/ui/frp/signals/signals-docs.factor
"<$" made generic + moved to monads
[factor.git] / extra / ui / frp / signals / signals-docs.factor
1 USING: help.markup help.syntax models models.arrow sequences ui.frp.signals monads ;
2 IN: ui.frp.signals
3
4 HELP: <merge>
5 { $values { "models" "a list of models" } { "signal" basic-model } }
6 { $description "Creates a signal that merges the updates of others" } ;
7
8 HELP: <filter>
9 { $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-signal" filter-model } }
10 { $description "Creates a signal that uses the updates of another model only when they satisfy a given predicate" } ;
11
12 HELP: <fold>
13 { $values { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" model } { "signal" model } }
14 { $description "Similar to " { $link reduce } " but works on models, applying a quotation to the previous and new values at each update" } ;
15
16 HELP: <switch>
17 { $values { "signal1" model } { "signal2" model } { "signal'" model } }
18 { $description "Creates a signal that starts with the behavior of signal2 and switches to the behavior of signal1 on its update" } ;
19
20 HELP: <mapped>
21 { $values { "model" model } { "quot" "applied to model's value on updates" } { "signal" model } }
22 { $description "The signal version of an " { $link <arrow> } } ;
23
24 HELP: $>
25 { $values { "model" model } { "quot" "applied to model's value on updates" } { "signal" model } }
26 { $description "Like " { $link <mapped> } ", but doesn't produce a new value" } ;
27
28 HELP: <$
29 { $values { "model" model } { "quot" "applied to model's value on updates" } { "signal" model } }
30 { $description "Opposite of " { $link <$ } "- gives output, but takes no input" } ;
31
32 HELP: frp-when
33 { $values { "model" model } { "quot" "called on the model if the quot yields true" } { "cond" "a quotation called on the model's value, yielding a boolean value"  } }
34 { $description "Calls quot when model updates if its value meets the condition set in cond" } ;
35
36 HELP: with-self
37 { $values { "quot" "quotation that recieves its own return value" } { "model" model } }
38 { $description "Fixed points for signals: the quot reacts to the same signal to gives" } ;
39
40 HELP: #1
41 { $values { "model" model } { "model'" model } }
42 { $description "Moves a signal to the top of its dependencies' connections, thus being notified before the others" } ;
43
44 ARTICLE: { "signals" "about" } "FRP Signals"
45 "Unlike models, which always have a value, signals have discrete start and end times. "
46 "They are the core of the frp library: program flow using frp is controlled entirely through manipulating and combining signals. "
47 "The output signals of some gadgets (see " { $vocab-link "ui.frp.gadgets" } " ) can be manipulated and used as the input signals of others. "
48 "To combine signals see " { $vocab-link "ui.frp.functors" } ;
49
50 ABOUT: { "signals" "about" }