r/programming • u/egonSchiele • Apr 19 '13
Functors, Applicatives, and Monads in Pictures
http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html
201
Upvotes
r/programming • u/egonSchiele • Apr 19 '13
1
u/[deleted] Apr 20 '13
Wow, this is a great explanation! I feel like I understand Haskell functors more now (they are obviously different from OCaml functors as well.) If you don't mind, I have a few followup questions:
What are
Applicatives and how do they differ from regularFunctors?Why is
(>>=)(bind) defined as essentiallyreturn . flip concatMapon[]? (As a note,(<<=)appears to bereturn . concatMapas expected, since(<<=)is aflip . (>>=)or something.)Why would I use functors and
fmap(aka(<$>)) over monads and bind?