Lab42.SimpleStateMachine v0.2.1 Lab42.StateMachine.Runner View Source
Runs the state machine by finding and executing transitions
Link to this section Summary
Functions
Convenience transformer function to stop the state machine, can be used with the atom :halt
Convenience function to push an input to the output without changing it, can be used with the atom :id
in
the transformer position of a transition, e.g. {~r{alpha}, :id, fn count, _ -> count + 1 end}
Convenience function to not change the data. It can be used with the atom :id
in
the updater position of a transition, e.g. {~r{alpha}, fn {_, line} -> String.reverse(line), :id}
Convenience function to ignore an input, it can be used with the atom :ignore
in
the transformer position of a transition, e.g. {~r{alpha}, :ignore, fn count, _ -> count + 1 end}
Link to this section Types
incomplete_transition_t()
View Sourceincomplete_transition_t() :: {trigger_t()} | {trigger_t(), symbolic_transformer_t()} | {trigger_t(), symbolic_transformer_t(), symbolic_updater_t()} | {trigger_t(), symbolic_transformer_t(), symbolic_updater_t(), state_t()}
normalized_transitions_t()
View Sourcenormalized_transitions_t() :: [ transition_t() | incomplete_transition_t() | empty_t() ]
symbolic_transformer_t()
View Sourcesymbolic_transformer_t() :: transformer_t() | atom()
transition_t()
View Sourcetransition_t() :: {trigger_t(), transformer_t(), updater_t(), state_t()}
Link to this section Functions
Convenience transformer function to stop the state machine, can be used with the atom :halt
Convenience function to push an input to the output without changing it, can be used with the atom :id
in
the transformer position of a transition, e.g. {~r{alpha}, :id, fn count, _ -> count + 1 end}
Convenience function to not change the data. It can be used with the atom :id
in
the updater position of a transition, e.g. {~r{alpha}, fn {_, line} -> String.reverse(line), :id}
Convenience function to ignore an input, it can be used with the atom :ignore
in
the transformer position of a transition, e.g. {~r{alpha}, :ignore, fn count, _ -> count + 1 end}