pure
(i -> o) -> Automaton i o
Create an automaton with no memory. It just applies the given function to every input.
init
o -> (i -> o -> o) -> Automaton i o
Create a stateful automaton. It takes a step function that uses the input and previous output to compute each new output. It also needs a default value for the first step when nothing has been output yet.
init'
s -> (i -> s -> (o,s)) -> Automaton i o
Create an automaton with hidden state. Requires an initial state and a step function to step the state forward and produce an output.
(>>>)
Automaton a b -> Automaton b c -> Automaton a c
Compose two automatons, chaining them together.
(<<<)
Automaton b c -> Automaton a b -> Automaton a c
combine
[Automaton a b] -> Automaton a [b]
Combine a list of automatons into a single automaton that produces a list.
run
Automaton a b -> Signal a -> Signal b
Run an automaton on a given signal. The automaton takes in ‘a’ values and returns ‘b’ values. The automaton steps forward whenever the input signal updates.
step
Automaton a b -> a -> (b, Automaton a b)
Step an automaton forward once with a given input.
count
Automaton a Int
Count the number of steps taken.
draggable
Form -> Automaton (Bool,(Int,Int)) Form
Create a draggable form that can be dynamically created and added to a scene.
(^>>)
(a -> b) -> Automaton b c -> Automaton a c
Turn a pure function into an automaton and compose it with an existing automaton.
(>>^)
Automaton a b -> (b -> c) -> Automaton a c
(<<^)
Automaton b c -> (a -> b) -> Automaton a c
(^<<)
(b -> c) -> Automaton a b -> Automaton a c
Create
Evaluate
Combine
Pre-defined Automatons
Composition Helpers
This library is a way to package up dynamic behavior. It makes it easier to dynamically create dynamic components. See the original release notes on this library to get a feel for how it can be used.
Automaton