packages feed

FiniteCategories-0.1.0.0: test/ExampleSet/ExamplePowerOrdSet.hs

{-| Module  : FiniteCategories
Description : An example of a power set category.
Copyright   : Guillaume Sabbagh 2021
License     : GPL-3
Maintainer  : guillaumesabbagh@protonmail.com
Stability   : experimental
Portability : portable

An example of power set category.
-}

module ExampleSet.ExamplePowerOrdSet
(
    power,
    main
)
where
    import              Set.FinOrdSet                          (FinOrdSet(..), powerFinOrdSet)
    import              Data.Set                               (Set(..), fromList)
    import              ExportGraphViz.ExportGraphViz          (catToPdf,genToPdf)

    -- | A category with all subsets of {1,2,3} as objects and applications as morphisms.
    power = powerFinOrdSet $ fromList [1..3] :: FinOrdSet Int

    -- | Export the power set of {1,2,3} as a pdf with GraphViz.
    main = do
        putStrLn "Start of ExamplePowerOrdSet"
        catToPdf power "OutputGraphViz/Examples/Set/powerOrdSet"
        putStrLn "End of ExamplePowerOrdSet"