on master help sign in
Data.Morphisms: add casts between morphisms where possible
48a8923Michael Morgan
libs/base/Data/Morphisms.idr+12
@@ -40,3 +40,15 @@ infixr 1 ~>
40
40
41(~>) : Type -> Type -> Type
41(~>) : Type -> Type -> Type
42a ~> b = Morphism a b
42a ~> b = Morphism a b
43+
44+Cast (Endomorphism a) (Morphism a a) where
45+ cast (Endo f) = Mor f
46+
47+Cast (Morphism a a) (Endomorphism a) where
48+ cast (Mor f) = Endo f
49+
50+Monad m => Cast (Morphism a (m b)) (Kleislimorphism m a b) where
51+ cast (Mor f) = Kleisli f
52+
53+Cast (Kleislimorphism m a b) (Morphism a (m b)) where
54+ cast (Kleisli f) = Mor f