TuringLang / AbstractPPL.jl

Common types and interfaces for probabilistic programming
http://turinglang.org/AbstractPPL.jl/
MIT License
27 stars 7 forks source link

Ignore `identity` optic when composing #96

Closed sunxd3 closed 6 months ago

sunxd3 commented 7 months ago

In Setfield, compose a lens with IdentityLens will give back the lens, ref https://github.com/jw3126/Setfield.jl/blob/e31e1e361bd6a251124aa578122e6198b81197b5/src/lens.jl#L148-L152

This behavior can't be reimplemented in Accessors because identity is a Base function.

This PR is for backward compatibility.