Skip to content

Instantly share code, notes, and snippets.

@ludat
Created December 12, 2015 05:53
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 ludat/e7fb7e70039367b218fd to your computer and use it in GitHub Desktop.
Save ludat/e7fb7e70039367b218fd to your computer and use it in GitHub Desktop.
Simple skeleton for an elm app
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "3.0.0 <= v < 4.0.0",
"evancz/elm-effects": "2.0.1 <= v < 3.0.0",
"evancz/elm-html": "4.0.2 <= v < 5.0.0",
"evancz/start-app": "2.0.2 <= v < 3.0.0"
},
"elm-version": "0.16.0 <= v < 0.17.0"
}
import Html exposing (..)
import Effects
import StartApp
type alias AppState =
{ number: Int
}
type Action
= NoOp
init : (AppState, Effects.Effects Action)
init =
({number = 0}, Effects.none)
update : Action -> AppState -> (AppState, Effects.Effects a)
update action state =
case action of
NoOp ->
(state, Effects.none)
view : Signal.Address Action -> AppState -> Html
view address state =
p [] [text (toString state)]
app : StartApp.App AppState
app = StartApp.start
{ init = init
, update = update
, view = view
, inputs = []
}
main : Signal Html
main = app.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment