Add pure and >=> to kleisli category

This commit is contained in:
Frederik Hanghøj Iversen 2018-02-24 19:08:20 +01:00
parent be505cdfbe
commit e7abab0e4c

View file

@ -84,6 +84,15 @@ module Kleisli {a b : Level} ( : Category a b) where
-- pure : x → m x
-- flip (>>=) :: (a → m b) → m a → m b
--
pure : {X : Object} [ X , RR X ]
pure = ζ
-- Why is (>>=) not implementable?
--
-- (>>=) : m a -> (a -> m b) -> m b
-- (>=>) : (a -> m b) -> (b -> m c) -> a -> m c
_>=>_ : {A B C : Object} [ A , RR B ] [ B , RR C ] [ A , RR C ]
f >=> g = [ rr g f ]
IsIdentity = {X : Object}
rr ζ 𝟙 {RR X}
IsNatural = {X Y : Object} (f : [ X , RR Y ])