Skip to content

Instantly share code, notes, and snippets.

@pietro909
Created January 19, 2017 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietro909/8e57b140e1e319866584a5771c4af411 to your computer and use it in GitHub Desktop.
Save pietro909/8e57b140e1e319866584a5771c4af411 to your computer and use it in GitHub Desktop.
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