Lisp/Scheme/Clojure's map function doesn't just give you a list functor; it is also a zip-list applicative functor
Conversation
pure (+) <*> ZipList [1,2,3] <*> ZipList [4,5,6] == [5,7,9]
(map + '(1 2 3) '(4 5 6)) == '(5 7 9)
2
2
For a language at the "top of the abstraction continuum" (Paul Graham), Lisp functions tend to be disappointingly concrete
3
5
15
ie, just for this applicative map, Clojure needs an ISeq - you must define first, next, more, cons, count, empty, equiv, seq
4
4
The category theory view provides a unifying and simplifying discipline; the hacker way yields endless special cases
1
8
27
On the other way, Lisp's limited applicative probably has a much lower cognitive burden. There isn't a cottage industry of "map" tutorials
1
4
Is "functor with arbitrary arity" such a difficult concept? Why do all the applicative tutorials come out so tortured and complicated?
1
5
11
Replying to
Wow, that's actually a useful way to think of it. Applicative has always been pretty magical/mysterious to me.
I guess it's probably got to do with the fact that I don't use it all to much in my day-to-day langs, in contrast to functors and monads…
Exactly! I probably need to use it more to really get my head around it.
1
3
Show replies

