-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
julia> vnp = prefix(@varname(p), @varname(s[1].a))
s[1].a.p
julia> subsumes(@varname(s[1].a), vnp)
false
julia> vnp == @varname(s[1].a.p)
false
This arises because of the associativity of ComposedFunction -- for example in s[1].a.p
the lens can be either ComposedFunction(ComposedFunction(.p, .a), .[1]))
or it could be ComposedFunction(.p, ComposedFunction(.a, .[1]))
(full functions not shown for simplicity).
There are two ways to handle this. One is to carefully disambiguate all cases with lots of if/else or multiple dispatch methods. The other is to enforce normalisation such that ComposedFunction can only have ComposedFunction as its outer optic (for example) and not as its inner optic. That would require us to either write our own ComposedFunction or upstream it.
Metadata
Metadata
Assignees
Labels
No labels