{-| Module : FiniteCategories Description : An example of 'FunctorCategory' exported with GraphViz. Copyright : Guillaume Sabbagh 2022 License : GPL-3 Maintainer : guillaumesabbagh@protonmail.com Stability : experimental Portability : portable An example of 'FunctorCategory' exported with GraphViz. Export the category in the directory "OutputGraphViz\/Examples\/FiniteCategories\/FunctorCategory". -} module Math.FiniteCategories.FunctorCategory.Example ( main ) where import Data.WeakSet.Safe import Data.WeakMap.Safe import Math.FiniteCategory import Math.Categories import Math.FiniteCategories import Math.IO.FiniteCategories.ExportGraphViz import Math.IO.PrettyPrint import Numeric.Natural -- | An example of 'FunctorCategory' exported with GraphViz. main :: IO () main = do putStrLn "Start of Math.FiniteCategories.FunctorCategory.Example" catToPdf (FunctorCategory (numberCategory 2) (numberCategory 3)) "OutputGraphViz/Examples/FiniteCategories/FunctorCategory/FunctorCategory" sequence $ (uncurry diagToPdfCluster) <$> zip (setToList (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/FunctorCategory/functCluster"++).show) <$> (take (cardinal (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) [1..])) sequence $ (uncurry diagToPdf) <$> zip (setToList (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/FunctorCategory/funct"++).show) <$> (take (cardinal (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) [1..])) sequence $ (uncurry diagToPdf2) <$> zip (setToList (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/FunctorCategory/diag"++).show) <$> (take (cardinal (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) [1..])) sequence $ (uncurry natToPdf) <$> zip (setToList (arrows (FunctorCategory (numberCategory 2) (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/FunctorCategory/nat"++).show) <$> (take (cardinal (arrows (FunctorCategory (numberCategory 2) (numberCategory 3)))) [1..])) let diag = completeDiagram Diagram{src=discreteCategory (set [1,2]), tgt = (numberCategory 2), omap=memorizeFunction id (set [1,2]), mmap = weakMap []} diagToPdf2 diag "OutputGraphViz/Examples/FiniteCategories/PrecomposedFunctorCategory/Functor" catToPdf (PrecomposedFunctorCategory diag (numberCategory 3)) "OutputGraphViz/Examples/FiniteCategories/PrecomposedFunctorCategory/PrecomposedFunctorCategory" sequence $ (uncurry diagToPdf2) <$> zip (setToList (ob (PrecomposedFunctorCategory diag (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/PrecomposedFunctorCategory/precompFunct"++).show) <$> (take (cardinal (ob (PrecomposedFunctorCategory diag (numberCategory 3)))) [1..])) sequence $ (uncurry natToPdf) <$> zip (setToList (arrows (PrecomposedFunctorCategory diag (numberCategory 3)))) ((("OutputGraphViz/Examples/FiniteCategories/PrecomposedFunctorCategory/nat"++).show) <$> (take (cardinal (arrows (PrecomposedFunctorCategory diag (numberCategory 3)))) [1..])) putStrLn "End of Math.FiniteCategories.FunctorCategory.Example"