Skip to content

Instantly share code, notes, and snippets.

@brendanzab
Created August 6, 2015 08:46
Show Gist options
  • Save brendanzab/c8e6eb1f3defd2485c12 to your computer and use it in GitHub Desktop.
Save brendanzab/c8e6eb1f3defd2485c12 to your computer and use it in GitHub Desktop.
import Graphics.Element exposing (Element, show)
import Mouse
type alias Model =
{ n : Int
}
init : Model
init =
{ n = 0
}
update : Input -> Model -> Model
update () model =
{ model | n <- model.n + 1 }
view : Model -> Element
view model =
show model
type alias Input = ()
models : Signal Model
models = Signal.foldp update init Mouse.clicks
main : Signal Element
main =
Signal.map view models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment