You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While, it is not too bad, it might be worth adding two methods:
andThen inside of Focus, e.g. Focus[Foo](_.some.bar.andThen(customOptic))
focus on optics/applyOptics, e.g. customOptic.foucs(_.some.bar)
I am not sure these methods are worth the maintaince cost. We can also wait for 3.0 to be released and see the common use cases people have. We don't need to solve everything at once.
I think it's worth adding 1. because it allows users to create their own keywords as 'first-class' into the DSL. But with our current encoding, it is a little cumbersome to do because the quasi-quotes only work with an inheritance based approach - any custom user actions will likely change until we're happy with the current optics encoding.
For 'normal' composition, I don't believe it is worth the burden.
My vote is to wait until the encoding is done first; at that point we can have a tutorial to extend the DSL at the same time.
This would be useful for a second reason; which is we don't need to promote all operations into the Focus macro - only those we believe are common enough in general.
I think this feature can wait until after 3.0, we'll see what the users care about.
I don't like customOptic.focus, because focus is already defined as an extension method on everything, and this focus method does a different thing for optics.
Focus
goal is to provide the best syntax for the most common use cases, but we know we will never cover all scenarios.So at some point, users may need to mix custom optics with
Focus
, currently they can useandThen
:While, it is not too bad, it might be worth adding two methods:
andThen
inside ofFocus
, e.g.Focus[Foo](_.some.bar.andThen(customOptic))
focus
on optics/applyOptics, e.g.customOptic.foucs(_.some.bar)
I am not sure these methods are worth the maintaince cost. We can also wait for
3.0
to be released and see the common use cases people have. We don't need to solve everything at once.cc @yilinwei @kenbot
The text was updated successfully, but these errors were encountered: