{-| Module : FiniteCategories Description : An example of 'FunctorCategory' pretty printed. Copyright : Guillaume Sabbagh 2022 License : GPL-3 Maintainer : guillaumesabbagh@protonmail.com Stability : experimental Portability : portable An example of 'FunctorCategory' pretty printed. -} 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.PrettyPrint import Numeric.Natural -- | An example of 'FunctorCategory' pretty printed. main :: IO () main = do putStrLn "Start of Math.FiniteCategories.FunctorCategory.Example" putStrLn $ pprintFiniteCategory (FunctorCategory (numberCategory 2) (numberCategory 3)) sequence $ (putStrLn.pprint) <$> (setToList (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) sequence $ (putStrLn.pprint) <$> (setToList (ob (FunctorCategory (numberCategory 2) (numberCategory 3)))) sequence $ (putStrLn.pprint) <$> (setToList (arrows (FunctorCategory (numberCategory 2) (numberCategory 3)))) let diag = completeDiagram Diagram{src=discreteCategory (set [1,2]), tgt = (numberCategory 2), omap=memorizeFunction id (set [1,2]), mmap = weakMap []} (putStrLn.pprint) $ diag putStrLn $ pprintFiniteCategory (PrecomposedFunctorCategory diag (numberCategory 3)) sequence $ (putStrLn.pprint) <$> (setToList (ob (PrecomposedFunctorCategory diag (numberCategory 3)))) sequence $ (putStrLn.pprint) <$> (setToList (arrows (PrecomposedFunctorCategory diag (numberCategory 3)))) putStrLn "End of Math.FiniteCategories.FunctorCategory.Example"