{-# LANGUAGE MultiParamTypeClasses #-}
module UsualCategories.One
(
One(..)
)
where
import FiniteCategory.FiniteCategory
import IO.PrettyPrint
data One = One deriving (One -> One -> Bool
(One -> One -> Bool) -> (One -> One -> Bool) -> Eq One
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: One -> One -> Bool
$c/= :: One -> One -> Bool
== :: One -> One -> Bool
$c== :: One -> One -> Bool
Eq, Int -> One -> ShowS
[One] -> ShowS
One -> String
(Int -> One -> ShowS)
-> (One -> String) -> ([One] -> ShowS) -> Show One
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [One] -> ShowS
$cshowList :: [One] -> ShowS
show :: One -> String
$cshow :: One -> String
showsPrec :: Int -> One -> ShowS
$cshowsPrec :: Int -> One -> ShowS
Show)
instance Morphism One One where
source :: One -> One
source One
One = One
One
target :: One -> One
target One
One = One
One
@ :: One -> One -> One
(@) = (One -> One) -> One -> One -> One
forall a b. a -> b -> a
const((One -> One) -> One -> One -> One)
-> (One -> One -> One) -> One -> One -> One -> One
forall b c a. (b -> c) -> (a -> b) -> a -> c
.One -> One -> One
forall a b. a -> b -> a
const (One -> One -> One -> One) -> One -> One -> One -> One
forall a b. (a -> b) -> a -> b
$ One
One
instance FiniteCategory One One One where
ob :: One -> [One]
ob = [One] -> One -> [One]
forall a b. a -> b -> a
const [One
One]
identity :: Morphism One One => One -> One -> One
identity = One -> One -> One
forall a b. a -> b -> a
const(One -> One -> One) -> (One -> One) -> One -> One -> One
forall b c a. (b -> c) -> (a -> b) -> a -> c
.One -> One
forall a. a -> a
id
ar :: Morphism One One => One -> One -> One -> [One]
ar = (One -> One -> [One]) -> One -> One -> One -> [One]
forall a b. a -> b -> a
const((One -> One -> [One]) -> One -> One -> One -> [One])
-> ([One] -> One -> One -> [One])
-> [One]
-> One
-> One
-> One
-> [One]
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(One -> [One]) -> One -> One -> [One]
forall a b. a -> b -> a
const((One -> [One]) -> One -> One -> [One])
-> ([One] -> One -> [One]) -> [One] -> One -> One -> [One]
forall b c a. (b -> c) -> (a -> b) -> a -> c
.[One] -> One -> [One]
forall a b. a -> b -> a
const ([One] -> One -> One -> One -> [One])
-> [One] -> One -> One -> One -> [One]
forall a b. (a -> b) -> a -> b
$ [One
One]
instance GeneratedFiniteCategory One One One where
genAr :: Morphism One One => One -> One -> One -> [One]
genAr = One -> One -> One -> [One]
forall c m o.
(GeneratedFiniteCategory c m o, Morphism m o) =>
c -> o -> o -> [m]
defaultGenAr
decompose :: Morphism One One => One -> One -> [One]
decompose = One -> One -> [One]
forall c m o.
(GeneratedFiniteCategory c m o, Morphism m o) =>
c -> m -> [m]
defaultDecompose
instance PrettyPrintable One where
pprint :: One -> String
pprint One
One = String
"1"