diff --git a/t.elm b/t.elm new file mode 100644 index 000000000..217f095d6 --- /dev/null +++ b/t.elm @@ -0,0 +1,34 @@ +-- Click on the righthand screen and start pressing keys! + +import Char +import Graphics.Element exposing (..) +import Keyboard +import Signal exposing (..) +import String + +-- foldr : (Char -> b -> b) -> b -> String -> b +-- foldp : (a -> state -> state) -> state -> Signal a -> Signal state +-- foldp (\click total -> total + 1) 0 Mouse.clicks +-- map : (a -> result) -> Signal a -> Signal result + + + + + +main : Signal Element +main = Signal.map display state + + +state: Signal String +state = foldp String.cons "" chars + +chars: Signal String +chars = map (\keycode -> toString <| Char.fromCode keycode ) Keyboard.presses + + +display : String -> Element +display str = + flow right + [ show "The current state is : " + , show str + ] \ No newline at end of file