Last active
August 26, 2016 19:43
-
-
Save sharkdp/6ab3ee1c9aa532ed5b5c to your computer and use it in GitHub Desktop.
Flare version of https://gist.github.com/Thimoteus/7b53aa8de6476b931fe6
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
<!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> |
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 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