Created
December 12, 2015 05:53
-
-
Save ludat/e7fb7e70039367b218fd to your computer and use it in GitHub Desktop.
Simple skeleton for an elm app
This file contains 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
{ | |
"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" | |
} |
This file contains 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 (..) | |
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