]> gitweb.factorcode.org Git - factor.git/blob - extra/ui/frp/xfrp-docs.factor
modulization of ui.frp
[factor.git] / extra / ui / frp / xfrp-docs.factor
1 USING: help.markup help.syntax models monads sequences
2 ui.gadgets.buttons ui.gadgets.tracks ;
3 IN: ui.frp
4
5 ! Layout utilities
6
7 HELP: ,
8 { $values { "uiitem" "a gadget or model" } }
9 { $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
10 HELP: ->
11 { $values { "uiitem" "a gadget or model" } { "model" model } }
12 { $description "Like " { $link , } "but passes its model on for further use." } ;
13 HELP: <hbox>
14 { $values { "gadgets" "a list of gadgets" } { "track" track } }
15 { $syntax "[ gadget , gadget , ... ] <hbox>" }
16 { $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
17 HELP: <vbox>
18 { $values { "gadgets" "a list of gadgets" } { "track" track } }
19 { $syntax "[ gadget , gadget , ... ] <hbox>" }
20 { $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
21
22 ! Gadgets
23 HELP: <frp-button>
24 { $values { "text" "the button's label" } { "button" button } }
25 { $description "Creates an button whose model updates on clicks" } ;
26
27 HELP: <merge>
28 { $values { "models" "a list of models" } { "model" basic-model } }
29 { $description "Creates a model that merges the updates of others" } ;
30
31 HELP: <filter>
32 { $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-model" filter-model } }
33 { $description "Creates a model that uses the updates of another model when they satisfy a given predicate" } ;
34
35 HELP: <fold>
36 { $values { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" model } { "model'" model } }
37 { $description "Similar to " { $link reduce } " but works on models, applying a quotation to the previous and new values at each update" } ;
38
39 HELP: <switch>
40 { $values { "signal1" model } { "signal2" model } { "signal'" model } }
41 { $description "Creates a model that starts with the behavior of model1 and switches to the behavior of model2 on its update" } ;
42
43 ARTICLE: { "frp" "instances" } "FRP Instances"
44 "Models are all functors, as " { $link fmap } " corresponds directly to the " { $link "models.arrow" } " vocabulary. "
45 "Also, a gadget is a monad. Binding recieves a model and creates a new gadget." ;
46