Implement Mapping profunctors
This commit is contained in:
parent
36f5c18f0f
commit
f60914d41f
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue