[elm-discuss] Re: Forms with Floats / Dates

2017-07-25 Thread Vlad GURDIGA
Hi Simon! As a newcomer to Elm, I too have this issue fresh in my experience, and my approach has been similar to what Witold Szczerba’s: I’ve built myself a MyDate type to hold all the

[elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Robin Heggelund Hansen
First of all, let's agree that both Java and Javascript are successful languages in that you can solve most, if not any, given software problems in those languages. Does that mean the languages themselves are unproblematic? What does it mean to have a problem? Does it mean you cannot get

[elm-discuss] Re: Best practices for designing models in the Elm Architecture - lean or rich?

2017-07-25 Thread Kasey Speakman
I don't think it matters one way or another. Whatever you end up finding easier to maintain. What I would do is explicitly represent the BMI as its own module, probably with an accompanying data type. In the module operations like `updateHeight` and `updateWeight`, you could make sure that the

Re: [elm-discuss] Best practices for designing models in the Elm Architecture - lean or rich?

2017-07-25 Thread Christian Charukiewicz
In your expensive function example, you should be able to take advantage of Html.Lazy to prevent the view from re-running the expensive function unless its parameters change. By storing the derived data in the model rather than letting Elm handling the caching through the Lazy functions, you

Re: [elm-discuss] Best practices for designing models in the Elm Architecture - lean or rich?

2017-07-25 Thread Ray Toal
Great tip, thanks! On Tuesday, July 25, 2017 at 12:50:20 AM UTC-7, Christian Charukiewicz wrote: > > In your expensive function example, you should be able to take advantage > of Html.Lazy to prevent the view from re-running the expensive function > unless its parameters change. By storing

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Peter Damoc
On Mon, Jul 24, 2017 at 8:50 PM, Dave Ford wrote: > A lot of my early work was centered around UIs which made heavy use of >> inheritance and mutation. >> > I really don't think this is related to the original question. The > original question was not about inheritance or

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Peter Damoc
On Tue, Jul 25, 2017 at 3:32 AM, Erik Simmler wrote: > That said, what if we flip the question around? Given that we have > facilities for encapsulation (unexposed types), what would we gain by > adding a new set of concepts around mixing data/logic and syntactic sugar > in the

Re: [elm-discuss] Best practices for designing models in the Elm Architecture - lean or rich?

2017-07-25 Thread Peter Damoc
Keep derived data in the model if it makes sense to keep derived data in the model. If you have an expensive function that runs and computes a derived value and you would have to call frequently this function in your view, then by all means, computer the derived value in update and save it in the

Re: [elm-discuss] Immutable data design problem

2017-07-25 Thread Aaron VonderHaar
Ah yes, a nice complicated system :) If you're still looking for more abstract suggestions, here's how I would approach the problem: It sounds like you're trying to construct intermediate data structures that directly map to certain domain concepts, and then you later have to transform that