cat/src/Cat/Category/Monoid.agda

46 lines
1.2 KiB
Agda
Raw Normal View History

2018-02-25 13:28:01 +00:00
module Cat.Category.Monoid where
open import Agda.Primitive
open import Cat.Category
open import Cat.Category.Product
open import Cat.Category.Functor
import Cat.Categories.Cat as Cat
-- TODO: Incorrect!
module _ (a b : Level) where
private
= lsuc (a b)
-- Might not need this to be able to form products of categories!
postulate unprovable : IsCategory (Cat.RawCat a b)
open HasProducts (Cat.hasProducts unprovable)
record RawMonoidalCategory : Set where
field
category : Category a b
open Category category public
field
{{hasProducts}} : HasProducts category
mempty : Object
-- aka. tensor product, monoidal product.
mappend : Functor (category × category) category
record MonoidalCategory : Set where
field
raw : RawMonoidalCategory
open RawMonoidalCategory raw public
module _ {a b : Level} ( : MonoidalCategory a b) where
private
= a b
module MC = MonoidalCategory
open HasProducts MC.hasProducts
record Monoid : Set where
field
carrier : MC.Object
mempty : MC.Arrow (carrier × carrier) carrier
mappend : MC.Arrow MC.mempty carrier