Use omap/fmap

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-06 09:56:44 +01:00
parent bdd67aee53
commit 9173468b03

View file

@ -22,8 +22,6 @@ module Monoidal {a b : Level} ( : Category a b) where
open NaturalTransformation open NaturalTransformation
record RawMonad : Set where record RawMonad : Set where
field field
-- TODO rename fields here
-- R ~ m
R : EndoFunctor R : EndoFunctor
pureNT : NaturalTransformation F.identity R pureNT : NaturalTransformation F.identity R
joinNT : NaturalTransformation F[ R R ] R joinNT : NaturalTransformation F[ R R ] R
@ -40,9 +38,6 @@ module Monoidal {a b : Level} ( : Category a b) where
joinN : Natural F[ R R ] R joinT joinN : Natural F[ R R ] R joinT
joinN = proj₂ joinNT joinN = proj₂ joinNT
private
module R = Functor R
Romap = Functor.func* R Romap = Functor.func* R
Rfmap = Functor.func→ R Rfmap = Functor.func→ R
@ -51,15 +46,15 @@ module Monoidal {a b : Level} ( : Category a b) where
IsAssociative : Set _ IsAssociative : Set _
IsAssociative = {X : Object} IsAssociative = {X : Object}
joinT X R.func→ (joinT X) joinT X joinT (R.func* X) joinT X Rfmap (joinT X) joinT X joinT (Romap X)
IsInverse : Set _ IsInverse : Set _
IsInverse = {X : Object} IsInverse = {X : Object}
joinT X pureT (R.func* X) 𝟙 joinT X pureT (Romap X) 𝟙
× joinT X R.func→ (pureT X) 𝟙 × joinT X Rfmap (pureT X) 𝟙
IsNatural = {X Y} f joinT Y R.func→ f pureT X f IsNatural = {X Y} f joinT Y Rfmap f pureT X f
IsDistributive = {X Y Z} (g : Arrow Y (R.func* Z)) (f : Arrow X (R.func* Y)) IsDistributive = {X Y Z} (g : Arrow Y (Romap Z)) (f : Arrow X (Romap Y))
joinT Z R.func→ g (joinT Y R.func→ f) joinT Z Rfmap g (joinT Y Rfmap f)
joinT Z R.func→ (joinT Z R.func→ g f) joinT Z Rfmap (joinT Z Rfmap g f)
record IsMonad (raw : RawMonad) : Set where record IsMonad (raw : RawMonad) : Set where
open RawMonad raw public open RawMonad raw public