{-| Module  : FiniteCategories
Description : Six examples of 'DiscreteCategory' pretty printed.
Copyright   : Guillaume Sabbagh 2022
License     : GPL-3
Maintainer  : guillaumesabbagh@protonmail.com
Stability   : experimental
Portability : portable

Six examples of 'DiscreteCategory' pretty printed.

Pretty print categories __0__ up to __5__ .
-}
module Math.FiniteCategories.DiscreteCategory.Example
(
    main
)
where
    import Data.WeakSet.Safe
    
    import Math.FiniteCategories.DiscreteCategory
    import Math.IO.PrettyPrint
    import Math.FiniteCategory
    
    -- | Six examples of 'DiscreteCategory' pretty printed.

    main :: IO ()
    main :: IO ()
main = do
        String -> IO ()
putStrLn String
"Start of Math.FiniteCategories.DiscreteCategory.Example"
        let cats :: [DiscreteCategory Char]
cats = Set Char -> DiscreteCategory Char
forall a. Set a -> DiscreteCategory a
discreteCategory (Set Char -> DiscreteCategory Char)
-> (Int -> Set Char) -> Int -> DiscreteCategory Char
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (\Int
n -> String -> Set Char
forall a. [a] -> Set a
set (Int -> String -> String
forall a. Int -> [a] -> [a]
take Int
n [Char
'A'..])) (Int -> DiscreteCategory Char) -> [Int] -> [DiscreteCategory Char]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Int
0..Int
5]
        let ps :: [IO ()]
ps = (String -> IO ()
putStrLn(String -> IO ())
-> (DiscreteCategory Char -> String)
-> DiscreteCategory Char
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.DiscreteCategory Char -> String
forall c m o.
(FiniteCategory c m o, Morphism m o, PrettyPrint c, PrettyPrint m,
 PrettyPrint o, Eq m, Eq o) =>
c -> String
pprintFiniteCategory) (DiscreteCategory Char -> IO ())
-> [DiscreteCategory Char] -> [IO ()]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [DiscreteCategory Char]
cats
        [IO ()] -> IO [()]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [IO ()]
ps
        String -> IO ()
putStrLn String
"End of Math.FiniteCategories.DiscreteCategory.Example"