haphviz-0.1.2.1: Graphviz code generation with Haskell

Safe HaskellSafe
LanguageHaskell2010

Text.Dot.FSA

Description

Easy FSA visualisation

Synopsis

Documentation

data FSA Source

An easy way to generate an FSA visualization

You only need to specify the FSA definition and Haphviz takes care of the rest.

main :: IO ()
main = renderToStdOut $ fsaGraph
            ["a", "b", "c"]
            "a"
            ["b"]
            [("a", "b", "p"), ("b", "b", "q"), ("b", "c", "p")]
>>> runhaskell fsa.hs
> digraph haphviz {
>     node [width=<0>, height=<0>];
>     rankdir = LR;
>     0 [label=<a>];
>     1 [label=<b>, shape=<doublecircle>];
>     2 [label=<c>];
>     3 [style=<invis>];
>     3 -> 0;
>     0 -> 1 [label=<p>];
>     1 -> 1 [label=<q>];
>     1 -> 2 [label=<p>];
> }

Constructors

FSA 

Fields

fsaStates :: [Text]

Set of states

fsaInitial :: Text

Initial state

fsaAccepting :: [Text]

Accepting states

fsaEdges :: [(Text, Text, Text)]

Edges: From, To, Symbol