News for hackers. Stuff that matters.
Re:How I Start: Haskell by dllthomas on Monday November 17, 2014 @12:26PM (#8619224)
"Functions of pointers" do seem an in-place equivalent for simple lenses. Pointers themselves less so - you can't compose pointers, and they take zero (when getting) or one (when setting) argument whereas a lens takes one or two.

Much like traditional getters and setters, lenses can offer more functionality though - for instance, an angle can be got and set in radians or degrees.

Re:How I Start: Haskell by mightybyte on Monday November 17, 2014 @12:36PM (#8619282)
Yeah, that's interesting. I chose pointers because I was looking for a simple metaphor that imperative programmers would understand easily. If you ask random C programmer how to pass a single thing to a function such that you can both get and set it, pointers are the first thing that most of them will think of.