Stripe identity
off ComposedOptic
when test equality
#94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The method
was removed with the #91.
The trigger was:
Accessors
changes the order of composition (Accessors
follows function composition order, i.e.,f ∘ g
mean applyg
first, which I think is more intuitive), so we needed to adjust the above function for the new order or remove it.With my personal taste, I removed it (sorry for missing @torfjelde's comment here), because it strikes me a bit strange composing a
VarName
and anoptic
.WIthout this function, In DynamicPPL, we will need to do something like
VarName{getsym(vn)}(optic ∘ getoptic(vn))
explicitly, which works okay (modulo the extra code). (One current example inDynamicPPL
using∘
betweenVarName
andLens
.)But one issue surface:
Sometimes in
DynamicPPL
we need to retrieve a value from a dictionary likeDict(VarName{:a}(IndexLens(1)) => 1.0, ...)
, with varnameVarName{:a}(IndexLens(1) ∘ identity)
. Just as Tor's concern, this will fail.This PR implements a more allowing equality tests to circumvent this issue. But I am also happy to consider restoring the aforementioned
Base.:∘(vn::VarName{sym,<:Lens}, lens::Lens)
function.