Advertisement
Isti115

Elm runtime error SSCCE

Jun 1st, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import Html exposing (beginnerProgram, div, button, text)
  2. import Html.Events exposing (onClick)
  3.  
  4.  
  5. main =
  6. beginnerProgram { model = 5, view = view, update = update }
  7.  
  8.  
  9. view model =
  10. div []
  11. [ button [ onClick Decrement ] [ text "-" ]
  12. , div [] [ text (toString ((5 % model) * 0 + model)) ]
  13. , button [ onClick Increment ] [ text "+" ]
  14. ]
  15.  
  16.  
  17. type Msg = Increment | Decrement
  18.  
  19.  
  20. update msg model =
  21. case msg of
  22. Increment ->
  23. ((5 % model) * 0 + model) + 1
  24.  
  25. Decrement ->
  26. ((5 % model) * 0 + model) - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement