[elm-discuss] Re: How to write function that updates arbitrary element of a record

2016-10-23 Thread Leroy Campbell
I think I have something close to what you're looking for, but my solution makes me wonder, *why store text in your model rather than the parsed float/int values?* It seems like you want the parsed values for a calculation, not to format a paragraph of text. update : Msg -> Model -> Model updat

[elm-discuss] Re: How to write function that updates arbitrary element of a record

2016-10-20 Thread Francesco Orsenigo
Can't you just create a smaller component that does the validation on itself, and then compose several of them into a list/dictionary? componentUpdate : (String -> Bool) -> Msg -> String componentUpdate hasError msg oldString = case UserEntersSomething newString if hasError newString then