Created
February 11, 2014 00:48
-
-
Save robotlolita/8927309 to your computer and use it in GitHub Desktop.
Shows different text than what was pressed
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
import Char | |
import Keyboard | |
import String | |
toString char = String.cons (Char.fromCode char) "" | |
typed text = plainText "You typed: " `beside` asText text | |
transformed text = plainText "I'll show you: " `beside` (asText . String.reverse <| text) | |
display text = flow down <| [ (typed text), (transformed text) ] | |
stringTogether char oldText = oldText ++ toString char | |
main = display <~ foldp stringTogether "" Keyboard.lastPressed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment