Define stuff in monoidal record

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-06 09:52:01 +01:00
parent cfb7925cb5
commit c57cd5c991

View file

@ -42,6 +42,13 @@ module Monoidal {a b : Level} ( : Category a b) where
private private
module R = Functor R module R = Functor R
Romap = Functor.func* R
Rfmap = Functor.func→ R
bind : {X Y : Object} [ X , Romap Y ] [ Romap X , Romap Y ]
bind {X} {Y} f = joinT Y Rfmap f
IsAssociative : Set _ IsAssociative : Set _
IsAssociative = {X : Object} IsAssociative = {X : Object}
joinT X R.func→ (joinT X) joinT X joinT (R.func* X) joinT X R.func→ (joinT X) joinT X joinT (R.func* X)
@ -396,23 +403,12 @@ module _ {a b : Level} { : Category a b} where
-- Note similarity with locally defined things in Kleisly.RawMonad!! -- Note similarity with locally defined things in Kleisly.RawMonad!!
module _ (m : M.RawMonad) where module _ (m : M.RawMonad) where
private
open M.RawMonad m open M.RawMonad m
module Kraw = K.RawMonad
RR : Object Object
RR = func* R
pure : {X : Object} [ X , RR X ]
pure {X} = pureT X
bind : {X Y : Object} [ X , RR Y ] [ RR X , RR Y ]
bind {X} {Y} f = joinT Y func→ R f
forthRaw : K.RawMonad forthRaw : K.RawMonad
Kraw.RR forthRaw = RR K.RawMonad.RR forthRaw = Romap
Kraw.pure forthRaw = pure K.RawMonad.pure forthRaw = pureT _
Kraw.bind forthRaw = bind K.RawMonad.bind forthRaw = bind
module _ {raw : M.RawMonad} (m : M.IsMonad raw) where module _ {raw : M.RawMonad} (m : M.IsMonad raw) where
private private
@ -506,8 +502,6 @@ module _ {a b : Level} { : Category a b} where
module _ (m : M.Monad) where module _ (m : M.Monad) where
open M.RawMonad (M.Monad.raw m) open M.RawMonad (M.Monad.raw m)
Romap = Functor.func* R
Rfmap = Functor.func→ R
rawEq* : Functor.func* (K.Monad.R (forth m)) Functor.func* R rawEq* : Functor.func* (K.Monad.R (forth m)) Functor.func* R
rawEq* = refl rawEq* = refl
left = Functor.raw (K.Monad.R (forth m)) left = Functor.raw (K.Monad.R (forth m))