{-| Module : FiniteCategories Description : An example of discrete diagram. Copyright : Guillaume Sabbagh 2021 License : GPL-3 Maintainer : guillaumesabbagh@protonmail.com Stability : experimental Portability : portable An example of discrete diagram. -} module ExampleDiagram.ExampleDiscreteDiagram ( discreteDiag, main ) where import RandomCompositionGraph.RandomCompositionGraph import System.Random import ExportGraphViz.ExportGraphViz (catToPdf,diagToPdf,diagToPdf2) import Diagram.Diagram (mkDiscreteDiagram) import CompositionGraph.CompositionGraph import Utils.Sample import FiniteCategory.FiniteCategory import Data.Maybe (fromJust) (rcg1,newGen) = (mkRandomCompositionGraph 10 10 3 (mkStdGen 567)) -- | The discrete diagram to a random composition graph where we select a few random objects. discreteDiag = fromJust $ mkDiscreteDiagram rcg1 (fst (sample (ob rcg1) 4 newGen)) -- | Export the discrete diagram as a pdf with GraphViz. main = do putStrLn "Start of ExampleDiscreteDiagram" catToPdf rcg1 "OutputGraphViz/Examples/Diagram/DiscreteDiagram/rcg1" diagToPdf discreteDiag "OutputGraphViz/Examples/Diagram/DiscreteDiagram/functor" diagToPdf2 discreteDiag "OutputGraphViz/Examples/Diagram/DiscreteDiagram/diag" putStrLn "End of ExampleDiscreteDiagram"