FiniteCategories-0.1.0.0: Finite categories and usual categorical constructions on them.
CopyrightGuillaume Sabbagh 2021
LicenseGPL-3
Maintainerguillaumesabbagh@protonmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ExportGraphViz.ExportGraphViz

Description

This module is a way of visualizing categories with GraphViz.

See Example.ExampleCompositionGraph or Example.ExampleSet.

Synopsis

Visualize categories

categoryToGraph :: (Eq o, PrettyPrintable o, PrettyPrintable m, Morphism m o, FiniteCategory c m o) => c -> Gr String String Source #

Transforms a category to representation as an inductive graph.

catToDot :: (Eq o, PrettyPrintable o, PrettyPrintable m, Morphism m o, GeneratedFiniteCategory c m o) => c -> String -> IO () Source #

Export a category with GraphViz. If the category is too large, use genToDot instead.

The black arrows are generating arrows, grey one are generated arrows.

catToPdf :: (Eq o, PrettyPrintable o, PrettyPrintable m, Morphism m o, GeneratedFiniteCategory c m o) => c -> String -> IO () Source #

Export a category with GraphViz. If the category is too large, use genToPdf instead.

The black arrows are generating arrows, grey one are generated arrows.

genToDot :: (Eq o, PrettyPrintable o, PrettyPrintable m, Morphism m o, GeneratedFiniteCategory c m o) => c -> String -> IO () Source #

Export the generator of a category with GraphViz. Use this when the category is to large to be fully exported.

genToPdf :: (Eq o, PrettyPrintable o, PrettyPrintable m, Morphism m o, GeneratedFiniteCategory c m o) => c -> String -> IO () Source #

Export the generator of a category with GraphViz. Use this when the category is to large to be fully exported.

Visualize diagrams

diagToDotCluster :: (Eq c1, Eq o1, PrettyPrintable o1, PrettyPrintable m1, Morphism m1 o1, GeneratedFiniteCategory c1 m1 o1, Eq c2, Eq o2, PrettyPrintable o2, PrettyPrintable m2, Morphism m2 o2, GeneratedFiniteCategory c2 m2 o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a functor with GraphViz such that the source category is in green, the target in blue, the objects mapped together are in the same cluster.

diagToPdfCluster :: (Eq c1, Eq o1, PrettyPrintable o1, PrettyPrintable m1, Morphism m1 o1, GeneratedFiniteCategory c1 m1 o1, Eq c2, Eq o2, PrettyPrintable o2, PrettyPrintable m2, Morphism m2 o2, GeneratedFiniteCategory c2 m2 o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a functor as a pdf with GraphViz such that the source category is in green, the target in blue, the objects mapped together are in the same cluster.

diagToDot :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a diagram with GraphViz such that the source category is in green, the target in blue, each morphism is represented by a node.

diagToPdf :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a diagram as a pdf with GraphViz such that the source category is in green, the target in blue, each morphism is represented by a node.

diagToDot2 :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a diagram with GraphViz such that a node or an arrow is in orange if it is the target of the functor.

diagToPdf2 :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => Diagram c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a diagram as a pdf with GraphViz such that a node or an arrow is in orange if it is the target of the functor.

Visualize natural transformations

natToDot :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => NaturalTransformation c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a natural transformation with GraphViz such that the source diagram is in green, the target diagram is in blue and the translation is in yellow.

natToPdf :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => NaturalTransformation c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a natural transformation as pdf with GraphViz such that the source diagram is in green, the target diagram is in blue and the translation is in yellow.

Visualize cones

coneToDot :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => NaturalTransformation c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a cone with GraphViz such that the source diagram is in green, the target diagram is in blue and the translation is in yellow.

coneToPdf :: (Morphism m1 o1, FiniteCategory c1 m1 o1, Eq o1, Eq m1, PrettyPrintable m1, PrettyPrintable o1, Morphism m2 o2, FiniteCategory c2 m2 o2, Eq o2, Eq m2, PrettyPrintable m2, PrettyPrintable o2) => NaturalTransformation c1 m1 o1 c2 m2 o2 -> String -> IO () Source #

Export a cone as pdf with GraphViz such that the source diagram is in green, the target diagram is in blue and the translation is in yellow.