kenbot / goggles

Pleasant, yet principled Scala optics DSL
MIT License
196 stars 7 forks source link

How could I chain together sets? #42

Closed PhilAndrew closed 6 years ago

PhilAndrew commented 6 years ago
val a = set"$to.name" := from.contractName
val b = set"$a.code" := from.code
val c = set"$b.something" := from.somethingName
c

Its often the case that I will need to chain sets together like above, is there is easy syntax for the above?

kenbot commented 6 years ago

Thanks for the report, Phil. We don't support this yet, but we'd like to: it's clearly a common optics use case. Issue #13 is already open for this.

I'll close this as a duplicate.

kenbot commented 6 years ago

@PhilAndrew I forgot to add, please consider adding a comment to #13 if you have some idea for how this feature should look, or syntax suggestions that are compatible with the goals of the project - this issue doesn't have a path forward at the moment and needs more ideas.