Created
January 19, 2017 15:01
-
-
Save pietro909/8e57b140e1e319866584a5771c4af411 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (beginnerProgram, div, input, text) | |
import Html.Events exposing (onInput) | |
main = | |
beginnerProgram | |
{ model = | |
{ name = "" | |
} | |
, view = view | |
, update = update | |
} | |
type alias Model = | |
{ name : String | |
} | |
view model = | |
div [] | |
[ input [ onInput Text ] [] | |
, div [] [ text (toString model) ] | |
] | |
type Msg = Text String | |
update msg model = | |
case msg of | |
Text name -> | |
{ model | name = name } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment