Skip to content

Instantly share code, notes, and snippets.

@srikumarks
Created June 19, 2015 07:29
Show Gist options
  • Save srikumarks/7aeff1ae24d7884bbd9c to your computer and use it in GitHub Desktop.
Save srikumarks/7aeff1ae24d7884bbd9c to your computer and use it in GitHub Desktop.
Elm StartApp as Automaton
module StartAppAutomaton where
import Graphics.Element exposing (..)
import Window
import Time
import Automaton as Auto
dt = Time.fps 60
type alias Model = {count : Int}
initialModel = {count = 0}
update : () -> Model -> (Element, Model)
update action model =
let m = {model | count <- model.count + 1}
in (view m, m)
view {count} = show count
app = Auto.hiddenState initialModel update
main = Auto.run app (view initialModel) Mouse.clicks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment