Programs are an abstraction over items, that have a dedicated result, and form an async monad.
Programs are an abstraction over items, that have a dedicated result, and form an async monad.
(await-action item pred & [not-running])
A program that shows the given item to start it, until it emits an
action where the given predicate holds, which is then returned as
the programs result. Shows not-running
when the program is not
running, which defaults to [[reacl-c.core/empty]].
A program that shows the given item to start it, until it emits an action where the given predicate holds, which is then returned as the programs result. Shows `not-running` when the program is not running, which defaults to [[reacl-c.core/empty]].
(await-state item & [done-state? not-running])
A program that shows the given item to start it, until its state is a
non-nil value, or the given predicate holds, returning that value as
the program's result. Shows not-running
when the program is not
running, which defaults to [[reacl-c.core/empty]].
A program that shows the given item to start it, until its state is a non-nil value, or the given predicate holds, returning that value as the program's result. Shows `not-running` when the program is not running, which defaults to [[reacl-c.core/empty]].
(defn-program name params & body)
A macro just like defn
, but where the body is wrapped in do-program
.
A macro just like `defn`, but where the body is wrapped in [[do-program]].
(do-program form & forms)
A monadic do notation for programs.
For example:
(do-program
[r1 (return 21)]
(return (* r1 2)))
A monadic do notation for programs. For example: ``` (do-program [r1 (return 21)] (return (* r1 2))) ```
(fmap f program)
A program that applies f to the result of the given program.
A program that applies f to the result of the given program.
(not-running p)
An item representing the program p
in the not-running state.
An item representing the program `p` in the not-running state.
(race program & programs)
A program running several programms in parallel, until the first one is finished, returning the result of that 'winner'.
A program running several programms in parallel, until the first one is finished, returning the result of that 'winner'.
(return v)
A program that immediately returns the given value once when run.
A program that immediately returns the given value once when run.
(runner program & [handle-result-f])
An item that runs the given program once, offering an event handler for handling the result of the program.
An item that runs the given program once, offering an event handler for handling the result of the program.
(sequ program & programs)
A program consisting of several programs run one after the other, returning the result of the last one.
A program consisting of several programs run one after the other, returning the result of the last one.
(show item)
A program that just shows the given item, but never completes.
A program that just shows the given item, but never completes.
(sleep ms)
A program that returns nil
after the given number of milliseconds
have elapsed.
A program that returns `nil` after the given number of milliseconds have elapsed.
(then program cont)
A program that runs program
first, and then the program (cont result)
, where result
is the result of the first program.
A program that runs `program` first, and then the program `(cont result)`, where `result` is the result of the first program.
(wrap f program)
A program wrapped in some additional markup, via (f item)
, where
item
is the item representing the program in either the running or
the non-running state.
A program wrapped in some additional markup, via `(f item)`, where `item` is the item representing the program in either the running or the non-running state.
(wrap* f program)
A program wrapped in some additional markup, via (f item running?)
,
where item
is the item representing the program, and running?
a
boolean specifying if the program is in the running state or not.
A program wrapped in some additional markup, via `(f item running?)`, where `item` is the item representing the program, and `running?` a boolean specifying if the program is in the running state or not.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close