]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/models/combinators/combinators-docs.factor
a7e3e8c4c7beb9c6c69b36738b4ea564c0d488fb
[factor.git] / unmaintained / models / combinators / combinators-docs.factor
1 USING: help.markup help.syntax models models.arrow sequences monads ;
2 IN: models.combinators
3
4 HELP: merge
5 { $values { "models" "a list of models" } { "model" basic-model } }
6 { $description "Creates a model that merges the updates of others" } ;
7
8 HELP: filter-model
9 { $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-model" filter-model } }
10 { $description "Creates a model that uses the updates of another model only when they satisfy a given predicate" } ;
11
12 HELP: fold
13 { $values { "model" model } { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" 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-models
17 { $values { "model1" model } { "model2" model } { "model'" model } }
18 { $description "Creates a model that starts with the behavior of model2 and switches to the behavior of model1 on its update" } ;
19
20 HELP: <mapped>
21 { $values { "model" model } { "quot" "applied to model's value on updates" } { "model" model } }
22 { $description "An expanded version of " { $link <arrow> } ". Use " { $link fmap } " instead." } ;
23
24 HELP: when-model
25 { $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"  } }
26 { $description "Calls quot when model updates if its value meets the condition set in cond" } ;
27
28 HELP: with-self
29 { $values { "quot" "quotation that recieves its own return value" } { "model" model } }
30 { $description "Fixed points for models: the quot reacts to the same model to gives" } ;
31
32 HELP: #1
33 { $values { "model" model } { "model'" model } }
34 { $description "Moves a model to the top of its dependencies' connections, thus being notified before the others" } ;
35
36 ARTICLE: "models.combinators" "Extending models"
37 "The " { $vocab-link "models.combinators" } " library expands models to have discrete start and end times. "
38 "Also, it provides methods of manipulating and combining models, expecially useful when programming user interfaces: "
39 "The output models of some gadgets (see " { $vocab-link "ui.gadgets.controls" } " ) can be manipulated and used as the input models of others." ;
40
41 ABOUT: "models.combinators"