How to make the product of two lenses?
问题 If I have two lenses: foo :: Lens' X Foo bar :: Lens' X Bar Is there a way to construct a product lens: foobar :: Lens' X (Foo, Bar) foobar = ... foo bar or is it impossible? 回答1: In general case, this is impossible. Probably the most common case when you have lenses to different fields of the record, the lenses are disjoint, so you can make a lawful lens. But in general it's not true. This is why the combinator is not provided in the libraries, even it would be easy to write. Assume lensProd