Created
June 19, 2015 07:29
-
-
Save srikumarks/7aeff1ae24d7884bbd9c to your computer and use it in GitHub Desktop.
Elm StartApp as Automaton
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
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