crem-0.1.0.0: Compositional representable executable machines
Safe HaskellSafe-Inferred
LanguageGHC2021

Crem.Render.RenderFlow

Description

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

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.

Instances

Instances details
Show a => Show (TreeMetadata a) Source # 
Instance details

Defined in Crem.Render.RenderFlow

renderFlow :: TreeMetadata MachineLabel -> StateMachineT m input output -> Either String (Mermaid, MachineLabel, MachineLabel) Source #

Given a StateMachineT and a TreeMetadata of MachineLabels, 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