Skip to content

Instantly share code, notes, and snippets.

@brendanzab
Last active August 29, 2015 14:24
Show Gist options
  • Save brendanzab/5f2ec58a0bf6f3ea4318 to your computer and use it in GitHub Desktop.
Save brendanzab/5f2ec58a0bf6f3ea4318 to your computer and use it in GitHub Desktop.
{
"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": {
"TheSeamau5/elm-history": "1.0.0 <= v < 2.0.0",
"elm-lang/core": "2.1.0 <= v < 3.0.0"
},
"elm-version": "0.15.1 <= v < 0.16.0"
}
import History
import Graphics.Element exposing (Element, show)
import Mouse
import Signal exposing ((<~))
import Task exposing (Task)
makeTitle : Int -> String
makeTitle n = "n = " ++ toString n
port title : Signal String
port title = makeTitle <~ counts
makeHash : Int -> String
makeHash n = "#" ++ toString n
port runTask : Signal (Task error ())
port runTask = History.setPath <~ (makeHash <~ counts)
update : () -> Int -> Int
update () n = n + 1
counts : Signal Int
counts = Signal.foldp update 0 Mouse.clicks
main : Signal Element
main = show <~ counts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment