sessiontypes-0.1.2: Session types library

Safe HaskellNone
LanguageHaskell2010

Control.SessionTypes.Visualize

Description

This module defines an interpreter for visualizing session types.

Using visualize or visualizeP you can create a diagram that displays a session type using a set of nodes and arrows that connect these nodes.

Synopsis

Documentation

visualize :: forall m ctx s r a. (MonadSession m, MkDiagram s) => m (Cap ctx s) r a -> IO () Source #

Visualizes the session type of a given STTerm You may use this function in the following way

main = visualize st

Then the following command will generate a diagram named "sessiontype.png"

stack exec vis-sessiontype -- -o sessiontype.png -w 400

For more information on how to generate a diagram please visit the diagrams package

visualizeP :: MkDiagram s => Proxy s -> IO () Source #

Visualizes a given session type denoted by a Proxy.

type MkDiagram s = (Coordinates s, PlaceNodes s) Source #

Necessary type constraints for making a diagram