>
> ... anyway I hope you get the idea.
>
If the real code was this short, I'd suggest inlining it, but the real code
is probably long enough to warrant this style.
> they start to *resemble *OO/imperitive style variable assignments
>
But they're not. You can't assign to the same value more than once. You can
actually have some values before the *in* depend on others, but you can't
do so circularly-- so subject to those dependencies the values may be bound
in any order. And doing these assignments can only affect anything else
through how the in-expression is used; they don't attach to an object or
contaminate global scope.
> eg chain the model through individual updating functions using '|>'
>
Chaining is great when you want to apply many transformations in sequence.
Let-bindings are parallel. If it makes sense to have reusable, atomic
update functions for your record ("updateVelocity"), go for it. But doing a
batch update of a record with let-bound values feels more natural.
> Any strong opinions about this?
>
We try not to have strong opinions. Write code that is correct, explicit,
and concise (prioritize in that order). Language features and code style
are in service to that goal.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.