Created
November 27, 2013 14:01
-
-
Save funrep/7676158 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
right :: Event t Bool | |
left :: Event t Bool | |
ship = accumB 100 move | |
move n = whenMove left (fmap ($ n) add) | |
`union` whenMove right (fmap ($ n) sub) | |
add = once (+ 1) <@ tick | |
sub = once (flip (-) 1) <@ tick | |
whenMove e = whenE (stepper False e) | |
once = flip accumE never |
Author
funrep
commented
Nov 27, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment