Thanks Ben, for very useful informations! 2013年7月27日土曜日 13時31分41秒 UTC+9 Ben: > > if you want to use that fmap (or, I'd think, the fmaps provided by either > morph or fluokitten) with uneven depths, you'd have to wrap them in a > defrecord or deftype, I'd expect. >
I see. 2013年7月27日土曜日 13時37分28秒 UTC+9 Ben: > > user=> (defmethod f/fmap Object [f v] (f v)) ;;; "Identity" functor > #<MultiFn clojure.lang.MultiFn@5de33e> > user=> (defmethod f/fmap clojure.lang.IPersistentMap [f v] (into {} (map > (fn [[k v]] [k (f/fmap f v)]) v))) > #<MultiFn clojure.lang.MultiFn@5de33e> > user=> (f/fmap inc {:a {:y 1} :b {:x 2 :z {:c [1 2 3]}}}) > {:a {:y 2}, :b {:z {:c [2 3 4]}, :x 3}} > > But I wouldn't recommend it. > One way. It can be used, I think. Thanks again. Regards, Y.Kohyama -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.