{-| Module : FiniteCategories Description : An example of slice category. Copyright : Guillaume Sabbagh 2021 License : GPL-3 Maintainer : guillaumesabbagh@protonmail.com Stability : experimental Portability : portable An example of slice category. -} module ExampleCommaCategory.ExampleSliceCategory ( sliceCategory, main ) where import RandomCompositionGraph.RandomCompositionGraph import System.Random import ExportGraphViz.ExportGraphViz (catToPdf,diagToPdf,diagToPdf2) import Diagram.Diagram (mkIdentityDiagram) import FiniteCategory.FiniteCategory import CommaCategory.CommaCategory import Utils.Sample import Data.Maybe (rcg1,newGen) = (defaultMkRandomCompositionGraph (mkStdGen 83456789)) -- | The category of objects over a random one. sliceCategory = fromJust $ mkSliceCategory rcg1 (fst (pickOne (ob rcg1) newGen)) -- | Export the slice category as a pdf with GraphViz. main = do putStrLn "Start of ExampleSliceCategory" catToPdf rcg1 "OutputGraphViz/Examples/CommaCategory/SliceCategory/rcg" catToPdf sliceCategory "OutputGraphViz/Examples/CommaCategory/SliceCategory/slice" putStrLn "End of ExampleSliceCategory"