Does fmap remove enough complexity to warrant it's own fn? Here's what fmap would now look like.
(def fmap (partial same map)) Granted, it's probably the #1 use for same, so you might have a point. Sean On Oct 29, 12:44 am, Konrad Hinsen <konrad.hin...@fastmail.net> wrote: > On 28.10.2010, at 21:57, Sean Devlin wrote: > > > Okay, functor is a good idea but a weak implementation. My complaint > > is that it only provides functor behavior for the map function. same > > is a higher order function that works on anything, and is based on > > protocols. Take a look at the test cases to understand what I'm > > talking about. > > I agree that a muiltimethod is no longer the best choice for implementing > functor-like functionality in Clojure, now that we have protocols. But I > think that the mathematical abstraction of a functor is of use (for reasoning > about programs) and should be visible as such. "same" seems more concerned > about abstracting away implementation details, e.g. between the different map > implementations, than with implementing a well-defined mathematical concept. > > > This should replace the contrib lib, because it provide more > > functionality. > > I'd say that something like same should be used to implement something like > fmap. > > Konrad. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en