Am Donnerstag, 23. Juni 2016 10:59:32 UTC+2 schrieb Peter Damoc:
>
> It is preferable to case against a finite number of cases than against an
> infinite number that forces you to have a "_" fallback.
Indeed. Replacing the cases of strings by cases of the finite number of
CheckBox type const
Excellent!
Here is another take on this extraction just to give you some food for
thought.
import Html exposing (..)
import Html.App exposing (beginnerProgram)
import Html.Attributes exposing (..)
import Html.Events exposing (onCheck, onClick)
main =
beginnerProgram { model = model, view
Thanks Peter! You are right: I simply forgot to add model as argument to my
radio function.
For whom it may interest, this is my revised version that works as required
- with little minor improvments:
- I replaced the clear checkbox by a button and changed the Model and Msg
type and the update
You should have gotten a compiler error in your radio code but you somehow
ended up with the wrong thing. :)
The model in the radio is not the current model of your running up but it
is the initial model which is also called "model".
So, make sure your radio buttons receive the current value of t
Hi,
as a former enthusiastic Haskell programmer I got excited about Elm and
eventually started today to learn Elm by examples
(http://elm-lang.org/examples).
My first exercise was about checkboxes:
http://elm-lang.org/examples/checkboxes
There at the very bottom an exercise is proposed:
> --