{-# LANGUAGE MultiParamTypeClasses #-} {-| Module : FiniteCategories Description : The __1__ category contains one object and its identity. Copyright : Guillaume Sabbagh 2022 License : GPL-3 Maintainer : guillaumesabbagh@protonmail.com Stability : experimental Portability : portable The __1__ category contains one object and its identity. You can construct it using 'NumberCategory', it is defined as a standalone category because it is often used unlike other number categories. -} module Math.FiniteCategories.One ( One(..) ) where import Math.FiniteCategory import Math.IO.PrettyPrint import Data.WeakSet.Safe -- | 'One' is a datatype used as the object type, the morphism type and the category type of __1__. data One = One deriving (Eq, Show) instance Morphism One One where source One = One target One = One (@?) One One = Just One instance Category One One One where identity One One = One ar One One One = set [One] instance FiniteCategory One One One where ob One = set [One] instance PrettyPrint One where pprint = show