Implement Mapping profunctors

This commit is contained in:
Kiana Sheibani 2023-03-06 21:39:12 -05:00
parent 36f5c18f0f
commit f60914d41f
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -16,3 +16,15 @@ interface (Traversing p, Closed p) => Mapping p where
where where
functor : Functor (\a => (a -> b) -> t) functor : Functor (\a => (a -> b) -> t)
functor = MkFunctor (\f => (. (. f))) functor = MkFunctor (\f => (. (. f)))
export
Mapping Morphism where
map' (Mor f) = Mor (map f)
roam f (Mor x) = Mor (f x)
export
[Function] Mapping (\a,b => a -> b)
using Traversing.Function Closed.Function where
map' = map
roam = id