Hi all, I really appreciate the ample feedback. As I am new to the functional style, Sergey, your input is extremely helpful. For some reason, I felt like I was supposed to have all my modifiers and data structure definitions in one place, which became unmanageable. I am currently refactoring to fit that structure an, so far it feels a lot cleaner and "right".
One thing I liked is that the lack of syntax for this was it forced me to find the more accepted functional pattern. However, I'd vote Ambrose's pattern points for clarity if one were to me incorporated. On Tuesday, August 2, 2016 at 11:44:25 AM UTC-7, Ambrose Laing wrote: > > When you say > > { model.primaryForecast.parameters | q = ... } > > it seems to me that the type of the argument to the left of the '|' is of > the same type as model.primaryForecast.parameters, so to me, > this means something whose type and value is the same as > model.primaryForecast.parameters, except that q has been changed. > > My suggestion: > > { model | model.primaryForecast.parameters.q = ... } > > makes it clearer, I think, that what you want is of type the same as > model, but for which the sub sub sub field called q is changed. > At least that is what I meant, if I didn't mention that. > > Then if I want something whose type is the same as a primaryForecast, but > whose q value has changed, one could write: > > { model.primaryForecast | parameters.q = ... } > > And if I want something of same type as model.primaryForecast.parameters, > but with q changed, one could write: > > { model.primaryForecast.parameters | q = ... } > > Anyway, this remains wishful, ... I am yet to grok the appeal of lenses. > > On Tuesday, August 2, 2016 at 12:34:24 PM UTC-4, Robin Heggelund Hansen > wrote: >> >> As far as I know, there is nothing against such a syntax, though I think >> the preferred syntax would be `{ model.primaryForecast.parameters | q = >> ...}` >> It just haven't been implemented yet. >> > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.