Skip to content

Instantly share code, notes, and snippets.

@mwunsch
Last active March 22, 2017 01:12
Show Gist options
  • Save mwunsch/99e70f774a9f065bac778aed505d4f9b to your computer and use it in GitHub Desktop.
Save mwunsch/99e70f774a9f065bac778aed505d4f9b to your computer and use it in GitHub Desktop.
Elm Boilerplate
module Main exposing (..)
-- Stick this Elm file in a directory. Run `elm make` in the
-- directory. Run `elm reactor`. Now you have an Elm program.
import Html exposing (..)
main : Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
}
-- MODEL
type alias Model =
{}
init : ( Model, Cmd Msg )
init =
( {}, Cmd.none )
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
-- VIEW
view : Model -> Html Msg
view model =
Html.text "Hello, world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment