Accessors.jl icon indicating copy to clipboard operation
Accessors.jl copied to clipboard

Add `==` definition of `ComposedOptic` and `IndexLens` from `Setfield`

Open sunxd3 opened this issue 1 year ago • 3 comments

Fix https://github.com/JuliaObjects/Accessors.jl/issues/144 Pretty much copy and paste

sunxd3 avatar Mar 22 '24 14:03 sunxd3

Looks like Aqua is not happy with the == for CompsedOptic, which is essentially defining for ComposedFunction. Not sure what to do here.

sunxd3 avatar Mar 22 '24 14:03 sunxd3

Also makes sense to add these equality methods to other optics defined in the file: eg DynamicIndexLens and Recursive.

aplavin avatar Mar 22 '24 16:03 aplavin

Also I just realize adding equality for DynamicIndexLens is tricky, because the f field is anonymous function like collection -> firstindex(collection), which makes equality tests generally impossible. Recursive is similar as Descent can be anonymous function.

sunxd3 avatar Mar 23 '24 10:03 sunxd3