FiniteCategories-0.6.0.1: Finite categories and usual categorical constructions on them.
CopyrightGuillaume Sabbagh 2022
LicenseGPL-3
Maintainerguillaumesabbagh@protonmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.IO.PrettyPrint

Description

A simple typeclass for things to be pretty printed. Categories objects and arrows should be pretty printable to be exported with graphviz. Different objects should be pretty printed into different strings or the graphviz export might be wrong.

Synopsis

Documentation

class PrettyPrint a where Source #

The typeclass of things that can be pretty printed.

pprint takes a level of verbosity as its first argument from the less verbose 'pprint 0' to the most verbose 'pprint n'.

Minimal complete definition

Nothing

Methods

pprint :: Int -> a -> String Source #

Pretty print an element of type a with a given verbosity level. 0 is the less verbose possible.

default pprint :: (Generic a, GPrettyPrint (Rep a)) => Int -> a -> String Source #

pprintWithIndentations Source #

Arguments

:: Int

The current verbosity level

-> Int

Original verbosity level

-> String

The indentation used

-> a

The object to pretty print

-> String 

Pretty print with a given level of indentation an element of type a with a given verbosity level. See pprintIndent for usage.

default pprintWithIndentations :: (Generic a, GPrettyPrint (Rep a)) => Int -> Int -> String -> a -> String Source #

pprintIndent :: Int -> a -> String Source #

Pretty print with indentation an element of type a with a given verbosity level.

Instances

Instances details
PrettyPrint DiscreteTwo Source # 
Instance details

Defined in Math.FiniteCategories.DiscreteTwo

PrettyPrint DiscreteTwoOb Source # 
Instance details

Defined in Math.FiniteCategories.DiscreteTwo

PrettyPrint Hat Source # 
Instance details

Defined in Math.FiniteCategories.Hat

PrettyPrint HatAr Source # 
Instance details

Defined in Math.FiniteCategories.Hat

PrettyPrint HatOb Source # 
Instance details

Defined in Math.FiniteCategories.Hat

PrettyPrint One Source # 
Instance details

Defined in Math.FiniteCategories.One

PrettyPrint Parallel Source # 
Instance details

Defined in Math.FiniteCategories.Parallel

PrettyPrint ParallelAr Source # 
Instance details

Defined in Math.FiniteCategories.Parallel

PrettyPrint ParallelOb Source # 
Instance details

Defined in Math.FiniteCategories.Parallel

PrettyPrint Square Source # 
Instance details

Defined in Math.FiniteCategories.Square

PrettyPrint SquareAr Source # 
Instance details

Defined in Math.FiniteCategories.Square

PrettyPrint SquareOb Source # 
Instance details

Defined in Math.FiniteCategories.Square

PrettyPrint V Source # 
Instance details

Defined in Math.FiniteCategories.V

PrettyPrint VAr Source # 
Instance details

Defined in Math.FiniteCategories.V

PrettyPrint VOb Source # 
Instance details

Defined in Math.FiniteCategories.V

PrettyPrint Int16 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Int32 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Int64 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Int8 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Word16 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Word32 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Word64 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Word8 Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Ordering Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Text Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Integer Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Natural Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint () Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Bool Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Char Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Double Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Float Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Int Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint Word Source # 
Instance details

Defined in Math.IO.PrettyPrint

(PrettyPrint t, Eq t) => PrettyPrint (Exponential t) Source # 
Instance details

Defined in Math.CartesianClosedCategory

PrettyPrint (FinSet a) Source # 
Instance details

Defined in Math.Categories.FinSet

(PrettyPrint a, Eq a) => PrettyPrint (Function a) Source # 
Instance details

Defined in Math.Categories.FinSet

PrettyPrint (Galaxy a) Source # 
Instance details

Defined in Math.Categories.Galaxy

PrettyPrint a => PrettyPrint (StarIdentity a) Source # 
Instance details

Defined in Math.Categories.Galaxy

PrettyPrint c => PrettyPrint (Op c) Source # 
Instance details

Defined in Math.Categories.Opposite

PrettyPrint m => PrettyPrint (OpMorphism m) Source # 
Instance details

Defined in Math.Categories.Opposite

PrettyPrint (OrdinalCategory a) Source # 
Instance details

Defined in Math.Categories.OrdinalCategory

PrettyPrint a => PrettyPrint (IsSmallerThan a) Source # 
Instance details

Defined in Math.Categories.TotalOrder

PrettyPrint (TotalOrder a) Source # 
Instance details

Defined in Math.Categories.TotalOrder

(PrettyPrint a, Eq a) => PrettyPrint (Set a) Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint a => PrettyPrint (Set a) Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint a => PrettyPrint (Maybe a) Source # 
Instance details

Defined in Math.IO.PrettyPrint

PrettyPrint a => PrettyPrint [a] Source # 
Instance details

Defined in Math.IO.PrettyPrint

Methods

pprint :: Int -> [a] -> String Source #

pprintWithIndentations :: Int -> Int -> String -> [a] -> String Source #

pprintIndent :: Int -> [a] -> String Source #

(PrettyPrint n, PrettyPrint e) => PrettyPrint (Arrow n e) Source # 
Instance details

Defined in Math.Categories.FinGrph

PrettyPrint (FinGrph n e) Source # 
Instance details

Defined in Math.Categories.FinGrph

(PrettyPrint n, PrettyPrint e, Eq n, Eq e) => PrettyPrint (Graph n e) Source # 
Instance details

Defined in Math.Categories.FinGrph

(PrettyPrint n, PrettyPrint e, Eq n, Eq e) => PrettyPrint (GraphHomomorphism n e) Source # 
Instance details

Defined in Math.Categories.FinGrph

PrettyPrint (FinSketch n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint n, PrettyPrint e, Eq e, Eq n) => PrettyPrint (LightConstruction n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint n, PrettyPrint e, Eq n, Eq e) => PrettyPrint (Sketch n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint n, PrettyPrint e, Eq e, Eq n) => PrettyPrint (SketchError n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint e, PrettyPrint n, Eq e, Eq n) => PrettyPrint (SketchMorphism n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint n, PrettyPrint e, Eq e, Eq n) => PrettyPrint (SketchMorphismError n e) Source # 
Instance details

Defined in Math.Categories.FinSketch

(PrettyPrint i, PrettyPrint t, Eq i) => PrettyPrint (Colimit i t) Source # 
Instance details

Defined in Math.CocompleteCategory

(PrettyPrint oIndex, PrettyPrint t, Eq oIndex) => PrettyPrint (Limit oIndex t) Source # 
Instance details

Defined in Math.CompleteCategory

Methods

pprint :: Int -> Limit oIndex t -> String Source #

pprintWithIndentations :: Int -> Int -> String -> Limit oIndex t -> String Source #

pprintIndent :: Int -> Limit oIndex t -> String Source #

(PrettyPrint a, PrettyPrint b, Eq a, Eq b) => PrettyPrint (CGMorphism a b) Source # 
Instance details

Defined in Math.FiniteCategories.CompositionGraph

(PrettyPrint a, PrettyPrint b, Eq a, Eq b) => PrettyPrint (CompositionGraph a b) Source # 
Instance details

Defined in Math.FiniteCategories.CompositionGraph

(PrettyPrint a, PrettyPrint b, Eq a, Eq b) => PrettyPrint (SCGMorphism a b) Source # 
Instance details

Defined in Math.FiniteCategories.SafeCompositionGraph

(PrettyPrint a, PrettyPrint b, Eq a, Eq b) => PrettyPrint (SafeCompositionGraph a b) Source # 
Instance details

Defined in Math.FiniteCategories.SafeCompositionGraph

(PrettyPrint m, PrettyPrint o) => PrettyPrint (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

(PrettyPrint a, Eq a, PrettyPrint b, Eq b) => PrettyPrint (Map a b) Source # 
Instance details

Defined in Math.IO.PrettyPrint

(PrettyPrint a, PrettyPrint b) => PrettyPrint (Either a b) Source # 
Instance details

Defined in Math.IO.PrettyPrint

(PrettyPrint a, PrettyPrint b) => PrettyPrint (a, b) Source # 
Instance details

Defined in Math.IO.PrettyPrint

Methods

pprint :: Int -> (a, b) -> String Source #

pprintWithIndentations :: Int -> Int -> String -> (a, b) -> String Source #

pprintIndent :: Int -> (a, b) -> String Source #

(PrettyPrint c, PrettyPrint o, PrettyPrint m, Eq o, Eq m) => PrettyPrint (CandidateExponentialObjectCategory c m o) Source # 
Instance details

Defined in Math.CartesianClosedCategory

(PrettyPrint o, PrettyPrint c, PrettyPrint m, Eq o, Eq m) => PrettyPrint (CandidateExponentialObjectMorphism c m o) Source # 
Instance details

Defined in Math.CartesianClosedCategory

(PrettyPrint o, PrettyPrint c, PrettyPrint m, Eq o, Eq m) => PrettyPrint (Tripod c m o) Source # 
Instance details

Defined in Math.CartesianClosedCategory

(PrettyPrint o1, PrettyPrint o2, PrettyPrint m3) => PrettyPrint (CommaObject o1 o2 m3) Source # 
Instance details

Defined in Math.Categories.CommaCategory

PrettyPrint (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

PrettyPrint c => PrettyPrint (ExponentialCategory c m o) Source # 
Instance details

Defined in Math.FiniteCategories.ExponentialCategory

(PrettyPrint m, PrettyPrint c, PrettyPrint o, Eq o, Eq m) => PrettyPrint (ExponentialCategoryMorphism c m o) Source # 
Instance details

Defined in Math.FiniteCategories.ExponentialCategory

(PrettyPrint o, PrettyPrint c, PrettyPrint m, Eq o, Eq m) => PrettyPrint (ExponentialCategoryObject c m o) Source # 
Instance details

Defined in Math.FiniteCategories.ExponentialCategory

(PrettyPrint c, PrettyPrint o, Eq o) => PrettyPrint (FullSubcategory c m o) Source # 
Instance details

Defined in Math.FiniteCategories.FullSubcategory

(PrettyPrint c, PrettyPrint o, Eq o) => PrettyPrint (InheritedFullSubcategory c m o) Source # 
Instance details

Defined in Math.FiniteCategories.FullSubcategory

(PrettyPrint c, PrettyPrint o, PrettyPrint m, Eq o, Eq m) => PrettyPrint (InheritedSubcategory c m o) Source # 
Instance details

Defined in Math.FiniteCategories.Subcategory

(PrettyPrint c, PrettyPrint o, PrettyPrint m, Eq o, Eq m) => PrettyPrint (Subcategory c m o) Source # 
Instance details

Defined in Math.FiniteCategories.Subcategory

(PrettyPrint a, PrettyPrint b, PrettyPrint c) => PrettyPrint (a, b, c) Source # 
Instance details

Defined in Math.IO.PrettyPrint

Methods

pprint :: Int -> (a, b, c) -> String Source #

pprintWithIndentations :: Int -> Int -> String -> (a, b, c) -> String Source #

pprintIndent :: Int -> (a, b, c) -> String Source #

(PrettyPrint a, PrettyPrint b, PrettyPrint c, PrettyPrint d) => PrettyPrint (a, b, c, d) Source # 
Instance details

Defined in Math.IO.PrettyPrint

Methods

pprint :: Int -> (a, b, c, d) -> String Source #

pprintWithIndentations :: Int -> Int -> String -> (a, b, c, d) -> String Source #

pprintIndent :: Int -> (a, b, c, d) -> String Source #

(PrettyPrint m1, PrettyPrint m2, PrettyPrint o1, PrettyPrint o2, PrettyPrint m3) => PrettyPrint (CommaMorphism o1 o2 m1 m2 m3) Source # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

pprint :: Int -> CommaMorphism o1 o2 m1 m2 m3 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> CommaMorphism o1 o2 m1 m2 m3 -> String Source #

pprintIndent :: Int -> CommaMorphism o1 o2 m1 m2 m3 -> String Source #

(PrettyPrint a, PrettyPrint b, PrettyPrint c, PrettyPrint d, PrettyPrint e) => PrettyPrint (a, b, c, d, e) Source # 
Instance details

Defined in Math.IO.PrettyPrint

Methods

pprint :: Int -> (a, b, c, d, e) -> String Source #

pprintWithIndentations :: Int -> Int -> String -> (a, b, c, d, e) -> String Source #

pprintIndent :: Int -> (a, b, c, d, e) -> String Source #

(PrettyPrint c1, PrettyPrint c2, PrettyPrint o1, PrettyPrint o2, PrettyPrint m1, PrettyPrint m2, Eq o1, Eq o2, Eq m1, Eq m2) => PrettyPrint (Diagram c1 m1 o1 c2 m2 o2) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> Diagram c1 m1 o1 c2 m2 o2 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> Diagram c1 m1 o1 c2 m2 o2 -> String Source #

pprintIndent :: Int -> Diagram c1 m1 o1 c2 m2 o2 -> String Source #

(PrettyPrint o1, PrettyPrint m1, PrettyPrint o2, PrettyPrint m2, Eq o1, Eq m1, Eq o2, Eq m2) => PrettyPrint (DiagramError c1 m1 o1 c2 m2 o2) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> DiagramError c1 m1 o1 c2 m2 o2 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> DiagramError c1 m1 o1 c2 m2 o2 -> String Source #

pprintIndent :: Int -> DiagramError c1 m1 o1 c2 m2 o2 -> String Source #

(PrettyPrint c1, PrettyPrint c2) => PrettyPrint (FunctorCategory c1 m1 o1 c2 m2 o2) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> FunctorCategory c1 m1 o1 c2 m2 o2 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> FunctorCategory c1 m1 o1 c2 m2 o2 -> String Source #

pprintIndent :: Int -> FunctorCategory c1 m1 o1 c2 m2 o2 -> String Source #

(PrettyPrint c1, PrettyPrint c2, PrettyPrint o1, PrettyPrint o2, PrettyPrint m1, PrettyPrint m2, Eq o1, Eq o2, Eq m1, Eq m2) => PrettyPrint (NaturalTransformation c1 m1 o1 c2 m2 o2) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> NaturalTransformation c1 m1 o1 c2 m2 o2 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> NaturalTransformation c1 m1 o1 c2 m2 o2 -> String Source #

pprintIndent :: Int -> NaturalTransformation c1 m1 o1 c2 m2 o2 -> String Source #

(Eq o1, PrettyPrint c1, PrettyPrint c2, PrettyPrint o1, PrettyPrint m1) => PrettyPrint (NaturalTransformationError c1 m1 o1 c2 m2 o2) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

(PrettyPrint c, PrettyPrint cIndex, PrettyPrint oIndex, PrettyPrint mIndex, PrettyPrint o, PrettyPrint m, Eq o, Eq m, Eq oIndex, Eq c, Eq mIndex, FiniteCategory c m o, Morphism m o) => PrettyPrint (LimitCategory cIndex mIndex oIndex c m o) Source # 
Instance details

Defined in Math.FiniteCategories.LimitCategory

Methods

pprint :: Int -> LimitCategory cIndex mIndex oIndex c m o -> String Source #

pprintWithIndentations :: Int -> Int -> String -> LimitCategory cIndex mIndex oIndex c m o -> String Source #

pprintIndent :: Int -> LimitCategory cIndex mIndex oIndex c m o -> String Source #

(PrettyPrint c1, PrettyPrint c3, PrettyPrint o1, PrettyPrint o3, PrettyPrint m1, PrettyPrint m3, PrettyPrint c2, PrettyPrint o2, PrettyPrint m2, Eq o1, Eq o3, Eq m1, Eq m3, Eq o2, Eq m2) => PrettyPrint (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) Source # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

pprint :: Int -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintIndent :: Int -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

(Eq o2, Eq o3, Eq m2, Eq m3, PrettyPrint c2, PrettyPrint c3, PrettyPrint o2, PrettyPrint o3, PrettyPrint m2, PrettyPrint m3, PrettyPrint c1) => PrettyPrint (PostcomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> PostcomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> PostcomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintIndent :: Int -> PostcomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

(Eq o1, Eq o2, Eq m1, Eq m2, PrettyPrint c1, PrettyPrint c2, PrettyPrint o1, PrettyPrint o2, PrettyPrint m1, PrettyPrint m2, PrettyPrint c3) => PrettyPrint (PrecomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) Source # 
Instance details

Defined in Math.Categories.FunctorCategory

Methods

pprint :: Int -> PrecomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintWithIndentations :: Int -> Int -> String -> PrecomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pprintIndent :: Int -> PrecomposedFunctorCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String Source #

pp :: PrettyPrint a => Int -> a -> IO () Source #

PutStrLn composed with pprint. Takes a verbosity level as its first argument.

ppi :: PrettyPrint a => Int -> a -> IO () Source #

PutStrLn composed with pprintIndent. Takes a verbosity level as its first argument.

indentation :: Int -> String -> String Source #

Add indentation at the begining of a string.

pprintFunction :: (PrettyPrint a, PrettyPrint b) => Int -> (a -> b) -> [a] -> String Source #

Pretty print a function on a specific domain.

Orphan instances

Simplifiable Text Source # 
Instance details

Methods

simplify :: Text -> Text #