Talk:Haskell/Lenses and functional references

Initial remarks
Potential trouble spots:


 * The body note about  is uncomfortably long. It is rather important, though, because it helps readers to make sense of the signatures in   and  . Promoting it to a sub-subsection is not an implausible option.
 * The section about operators is a little bare. Possible topics for an expansion include the operator naming conventions of lens, the curious case of  and exercises asking for rewrites of earlier examples. On the other hand, I'm not at all convinced it is worth it to dwell on various spellings of stuff. In fact, I only included a section about operators so that readers will not be puzzled by lens code in the wild, and also to make it easier to mention the   operators later on.
 * "A swiss army knife" is too generic a title. Breaking down the section ("State manipulation" + "Mirrors") might be appropriate, though in that case a place for the intro would have to be found.
 * The only reason why the section currently called "State manipulation" ignores,   and other   tools is that there is no chapter about reader functors elsewhere. That should be rectified in the (hopefully near) future.
 * Discussing the lens implementation of isomorphisms and prisms in depth would require introducing profunctors, which would be way too large a digression. That is unfortunate, but the damage is not that big.
 * It might be nice to have a subsection or the equivalent thereof comparing,   and.
 * It is tempting to mention the following important consequences of the lens laws, but it feels like too much of a digression:
 * If  is a lens and   and   are different, then   and   will be different as well. In other words,   is injective.
 * Given some,   is enough to produce all possible   values that only differ in the value targeted by  . In other words,   is surjective.
 * A lens can only have a single target. That can be proved using the fact that  is surjective.
 * Consequences analogous to the ones just above follow from the prism laws. In general, this section might be a good place to make parallels between lenses and prisms.
 * When talking about isomorphism laws, it would make sense to restate in some way that  and   undo each other.
 * I had lots of trouble to assemble a coherent yet brief narrative about polymorphic updates, and the overall result was probably not very good.
 * As a final review, it would be nice to include the optic constructors table (see draft below) in "No strings attached". However, the real types in lens are too quirky, requiring either excessive simplification or excessive explanation.
 * When there is a chapter talking about pipes, the pipes-group family of packages will make for a neat example of lens-less lenses.

Duplode (discuss • contribs) 02:16, 14 September 2015 (UTC)

Wording of the lead
Hi, I was wondering why are lenses "notorious"? --Sqdcn (discuss • contribs) 08:52, 30 April 2016 (UTC)


 * I don't think I chose that word specially well while writing the original version. "Well known" looks like a better fit (and I just have changed it to that). lens-the-library would perhaps be appropriately described as notorious, given the impact it had and how much debate it triggered. --Duplode (discuss • contribs) 04:22, 6 October 2016 (UTC)