-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Continuing the discussion from #31 (comment)
I thought it was useful for generic programming that supports immutable and mutable types simultaneously. But I never needed it in practice.
Same here :) Meaning that I thought it'd be useful but have never used yet. I'm hoping to use it soon for writing generic code for mutable arrays and StaticArray. So I thought I'd fix it for 0.7. But I'm not entirely sure if I can write such code without handling the difference manually in the end.
Also, for Setfield.jl to be usable in my code (especially with Julia 0.7), dot-fusions like .= and .+= also have to be implemented which would add more complexity.
OTOH I implement custom lenses from time to time and then the
MutationPolicymachinery just adds annoying complexity.
Do you mean it's cumbersome to write policy-aware lens? Thinking out loud, how about putting the policy in Lens type? This way, you can define policy-unaware lens. Additional benefit would be that you can compose Lens{EncourageMutation} and Lens{ForbidMutation} in arbitrary nested way.