Created
March 3, 2016 19:26
-
-
Save Zeroto/d9a4d4af55e0007af61d to your computer and use it in GitHub Desktop.
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 Html exposing (..) | |
import Html.Events exposing (onClick) | |
type alias F = Int -> Int | |
mailbox = Signal.mailbox identity | |
view address value = div [] [ text <| toString value | |
, button [onClick address ((+) 1)] [text "+"] | |
, button [onClick address ((-) 1)] [text "-"] | |
] | |
updates = Signal.foldp (<|) 0 mailbox.signal | |
main = Signal.map (view mailbox.address) updates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment