2. Functor
Functor f = > f b
Functor ( a - >) = > ( a - >) b
--- 終域だけ - only co - domain
fmap :: ( a -> b ) -> f a -> f b
--- 終域を変える - map co - domain
. . . . . .
3. Arrow
Arrow a => a b c
Arrow ( - >) = > ( - >) b c
--- 始域と終域が両方ある
--- both domain and co - domain
(^ > >) :: Arrow a = >
( b -> c ) -> a c d -> a b d
^ ^
--- 始域を変える - map domain
(^ < <) :: Arrow a = >
( c -> d ) -> a b c -> a b d
^ ^
--- 終域を変える - map co - domain
. . . . . .
4. ProFunctor
ProFunctor p = > p a b
--- 始域と終域が両方ある
--- both domain and co - domain
lmap :: ProFunctor p = >
( b -> c ) -> p c d -> p b d
^ ^
--- 始域を変える - map domain
rmap :: ProFunctor p = >
( b -> c ) -> p a b -> p a c
^ ^
--- 終域を変える - map co - domain
. . . . . .
5. Strong type class in profunctors
first ’ :: p a b -> p (a , c ) (b , c )
second ’ :: p a b -> p (c , a ) (c , b )
Arrow ( first , second )
. . . . . .
6. Choice type class in profunctors
left ’ :: p a b ->
p ( Either a c ) ( Either b c )
right ’ :: p a b ->
p ( Either c a ) ( Either c b )
ArrowChoice ( left , right )
. . . . . .