Skip to content

Instantly share code, notes, and snippets.

@arecvlohe
Created April 23, 2017 00:19
Show Gist options
  • Save arecvlohe/2fa96f0130ca85b84c26ea5322dacd9e to your computer and use it in GitHub Desktop.
Save arecvlohe/2fa96f0130ca85b84c26ea5322dacd9e to your computer and use it in GitHub Desktop.
module Main exposing (..)
import Html exposing (Html, text, div)
-- MODEL
type alias Model =
{ author : String
, quote : String
}
model : Model
model =
{ author = "Adam", quote = "Elm is a nice language to use!" }
-- VIEW
view : Model -> Html Msg
view model =
div []
[ div [] [ text model.quote ]
, div [] [ text model.author ]
]
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> Model
update msg model =
case msg of
NoOp ->
model
-- MAIN
main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = model
, update = update
, view = view
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment