Andrey, This is where I have a problem. Ii could have implemented dewdrop lenses as functions that could be composed. But the code would be harder to understand and possibly be slower. I just do not see the point.
Implementing dewdrop lenses as records makes it dirt simple for anyone to create more kinds of lenses. And the ladd function to create a new record with the composed getter and setter functions is pretty clean as well. Isn't it more important to have code you can analyze easily, and which even a novice clojurist like myself can embrace and enhance a whole lot more important than being able to say that we can use comp to compose these lenses??? I see good engineering as leveraging computer science so the programming grunts can make effective use of it. Programming is real grunt work, after all. No matter how much you dress it up, we all needs must get our hands dirty and put our backs into it. Bill On Friday, January 1, 2016 at 9:09:08 AM UTC-5, Andrey Antukh wrote: > > Hi! > > I have read the readme and I don't found a big evidence of something wrong > so, nice work! > Furthermore, do you know about https://github.com/funcool/cats ? It has a > lens and traversable implementation for clj/cljs. You can read the related > documentation here: http://funcool.github.io/cats/latest/#lens . > > You can found that lenses, using cats approach, are working just like > transducers (function composition), you do not need any special function > for combine lenses, just use comp. One of the readme examples (from your > repository) that combines two lenses, in cats can be written in this way: > > (require '[cats.labs.lens :as l]) > (def xy-lens (comp (l/key :x) (l/key :y)) > ;; Or just use (l/in [:x :y]) > > (l/focus xy-lens {:x {:y 1}}) > ;; => 1 > (l/over xy-lens inc {:x {:y 1}}) > ;; => {:x {:y 2}} > > Happy new year! > Andrey > > On Fri, Jan 1, 2016 at 2:54 PM, William la Forge <lafo...@gmail.com > <javascript:>> wrote: > >> I've been looking at lenses and while it looks pretty simple and very >> useful, I had a hard time getting it. So I came up with my own take on >> lenses. https://github.com/laforge49/dewdrop#readme >> >> So perhaps I still do not understand lenses and what I've done is wrong. >> Or perhaps having been through the exercise I'm now getting it and what >> I've done is no simpler than what everyone else has done. Or perhaps I've >> just described things with fewer technical terms. >> >> So I'd appreciate it if you would review this very short document and >> tell me what I don't understand. Or that I've actually done something >> worthwhile with lenses??? >> >> Thanks! >> Bill >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com >> <javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> 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+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Andrey Antukh - Андрей Антух - <ni...@niwi.nz <javascript:>> > http://www.niwi.nz > https://github.com/niwinz > -- 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/d/optout.