Skip to content

Instantly share code, notes, and snippets.

@sharkdp
Last active August 26, 2016 19:43
Show Gist options
  • Save sharkdp/6ab3ee1c9aa532ed5b5c to your computer and use it in GitHub Desktop.
Save sharkdp/6ab3ee1c9aa532ed5b5c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<h1>The world's simplest incremental game</h1>
<div id="controls"></div>
<div id="output"></div>
</body>
</html>
module Main where
import Prelude
import Control.Apply ((*>))
import Signal (Signal(), merge)
import Signal.Time (every, second)
import Flare (UI(), liftSF, button, foldp, runFlareShow)
tick :: Signal Int
tick = every second *> pure 1
score :: UI _ Int
score = foldp (+) 0 $ liftSF (merge tick) (button "Click me!" 0 1)
main = runFlareShow "controls" "output" score
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment