lens-join/list only follows lens laws when views of args don't overlap#302
Conversation
Codecov Report
@@ Coverage Diff @@
## master #302 +/- ##
==========================================
+ Coverage 97.98% 97.98% +<.01%
==========================================
Files 100 100
Lines 1736 1741 +5
==========================================
+ Hits 1701 1706 +5
Misses 35 35
Continue to review full report at Codecov.
|
|
FYI: I'm planning to review this and take care of some other lens maintenance this weekend. |
|
Ping, do you think you’ll have time to review this this weekend? |
|
Pong; I ought to have time for |
jackfirth
left a comment
There was a problem hiding this comment.
Two high level comments:
-
The proof is helpful, but it's a bit hard to read as comments mixed in with the implementation code. What if it was a separate
lens/private/list/join-list-prooftext / markdown file? -
I think the reason this comes up at all is because
lens-joinconceptually doesn't cooperate with the lens laws. We can't go safely from(Lens a b, Lens a c)toLens a (b, c)because we first have to prove thebandcparts ofaare independent. I'm not so sure it's a good idea to use it at all. But without isomorphisms, prisms, and traversals I can't think of any good alternatives.
What do you think?
|
(Re: 1) I wanted it to be in the same file because it should be "discoverable" to people that just want to change that one file. (Re: 2) A better alternative might look a bit like |
|
Alright, sounds reasonable enough to me. Merging. |
Fixes
lens-join/listfor #301, by specifying that the joined lens only follows the lens laws if the views of the argument lenses don't overlap.