Upcoming SlideShare
×

# Profunctor and Arrow

1,302 views
1,195 views

Published on

Published in: Technology
3 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

Views
Total views
1,302
On SlideShare
0
From Embeds
0
Number of Embeds
82
Actions
Shares
0
3
0
Likes
3
Embeds 0
No embeds

No notes for slide

### Profunctor and Arrow

1. 1. . ProFunctor and Arrow – profunctors hackage library –. Kei Hibino : http://twitter.com/khibino 2013-03-31 . . . . . .
2. 2. Functor Functor f = > f b Functor ( a - >) = > ( a - >) b --- 終域だけ - only co - domain fmap :: ( a -> b ) -> f a -> f b --- 終域を変える - map co - domain . . . . . .
3. 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. 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. 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. 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 ) . . . . . .
7. 7. Conclusion ProFunctor は Arrow の制約を分割して提供してい るイメージ . . . . . .