[Haskell-cafe] Lenses: Should I declare Getters?

2013-09-09 Thread Charlie Paul
I've been looking through Edward Kmett's lens library, and I'm a bit befuddled about Getters. In my own code, why would I want to have something be a Getter instead of a plain function? As far as I can see, a plain function is simpler to use, and can be converted to a Getter with "to" if we want to

[Haskell-cafe] Seeking Control.Lens Combinator

2013-10-04 Thread Charlie Paul
Hello, I'm looking for a combinator along the lines of (&&&) :: Lens' a b -> Lens' a b' -> Lens' a (b,b') I can see how it could lead to lenses that don't follow the laws, but for Lenses which are somehow independent (like _1 and _2), it works perfectly well. Is there a way in lens to specify this