Created
February 27, 2014 01:22
-
-
Save evancz/9242401 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
import Char (isDigit) | |
import String (all) | |
import Graphics.Input (Input, input, FieldContent, noContent, field) | |
main : Signal Element | |
main = scene <~ content.signal | |
content : Input FieldContent | |
content = input noContent | |
scene : FieldContent -> Element | |
scene fieldContent = | |
field content.handle id "Type words here" fieldContent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example shows a text field that just shows what you type. The content of a text field must be set programmatically to keep the field function pure. This means you pipe the content of the field through to the view.
From https://groups.google.com/d/msg/elm-discuss/du9x7E9AkDE/wKjLD1xpb9EJ
[Part of an ongoing project to index useful gists for newcomers to Elm. Believed correct when posted].