[elm-discuss] Re: can't understand compiler error

2017-02-25 Thread agjf . tucker
I just did this exercise too! My solution was to perform the validation from the update function and to save the error messages in the model. On Saturday, 25 February 2017 06:55:06 UTC, Anurup Mitra wrote: > > Dear Alex, > > This is very elegant indeed! I am bowled over by the simplicity of it a

[elm-discuss] Re: can't understand compiler error

2017-02-24 Thread Anurup Mitra
Dear Alex, This is very elegant indeed! I am bowled over by the simplicity of it all. So its like chaining mathematical functions... I'm off to read Learn You a Haskell. Thanks a ton mate! Best Regards Anurup -- You received this message because you are subscribed to the Google Groups "Elm

[elm-discuss] Re: can't understand compiler error

2017-02-24 Thread Alex Darlington
> > Hi Anarup, Try changing your update function to: update : Msg -> Model -> Model update msg model = case msg of Name name -> unsetFlag { model | name = name } Age age -> unsetFlag { model | age = age } Password password -> unset

[elm-discuss] Re: can't understand compiler error

2017-02-24 Thread Anurup Mitra
Peter, Witold and David, Thanks to all of you for having taken time out to reply to a novice! @ Peter : Your comment was an eye-opener. This wasn't obvious to me at all because I am still to wrap my head around the FRP paradigm... @ Witold : Your detailed reply is nothing short of exceptional.

[elm-discuss] Re: can't understand compiler error

2017-02-24 Thread David Legard
Think of it in terms of the type signature, in your case viewValidation : Model -> Html msg You are giving this function a Model, and every branch of this function must return a Html msg, nothing more, nothing less. The function is a black box - it expects a Model as input. It will return an H