Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Rendering just the state space of a state machine might be sometimes limiting.
Given that the StateMachineT
data type encodes a lot of information on the
structure of a machine, we can actually use it to render a more informative
flow.
Synopsis
- data TreeMetadata a
- = LeafLabel a
- | BinaryLabel (TreeMetadata a) (TreeMetadata a)
- renderFlow :: TreeMetadata MachineLabel -> StateMachineT m input output -> Either String (Mermaid, MachineLabel, MachineLabel)
Documentation
data TreeMetadata a Source #
A tree-like structure which could be used to attach metadata to any similar tree-like structure with only leaves and nodes with exactly two child.
LeafLabel a | |
BinaryLabel (TreeMetadata a) (TreeMetadata a) |
Instances
Show a => Show (TreeMetadata a) Source # | |
Defined in Crem.Render.RenderFlow showsPrec :: Int -> TreeMetadata a -> ShowS # show :: TreeMetadata a -> String # showList :: [TreeMetadata a] -> ShowS # |
renderFlow :: TreeMetadata MachineLabel -> StateMachineT m input output -> Either String (Mermaid, MachineLabel, MachineLabel) Source #
Given a StateMachineT
and a TreeMetadata
of MachineLabel
s, we can
create a flow representation of our machine.
For every leaf it will render the state space, while for every other node, it will render the flow between the composed machines.
More details available in /docs/how-to-render-a-machine.md