sessiontypes-0.1.0: 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 :: forall s. MkDiagram s => Proxy s -> IO () Source #

Visualizes a given session type denoted by a Proxy.

class MkDiagram s Source #

Type class for constructing a diagram that visualizes the session types

Instances

(Coordinates k s, PlaceNodes k s) => MkDiagram k s Source # 

Methods

mkDiagram :: Proxy (ST s) s -> IO (Diagram B)