Skip to content

Instantly share code, notes, and snippets.

@daniloisr
Created February 18, 2016 13:07
Show Gist options
  • Save daniloisr/a0c86a5e38796068dd92 to your computer and use it in GitHub Desktop.
Save daniloisr/a0c86a5e38796068dd92 to your computer and use it in GitHub Desktop.
import Signal exposing (..)
import Window exposing (..)
import Mouse exposing (..)
import Graphics.Element exposing (..)
type Input = Win (Int, Int) | Move (Int, Int) | NoOp
type alias Model = { input: Input }
initModel : Model
initModel = { input = NoOp }
update : Input -> Model -> Model
update input model = { model | input = input }
main =
mergeMany
[ map Win dimensions
, map Move position
]
|> foldp update initModel
|> map show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment