Created
December 30, 2015 18:28
-
-
Save freakingawesome/5f445fedc16a1f18ac72 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 Signal | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
type Action | |
= NoOp | |
type alias Model = | |
{ message : String } | |
init : Model | |
init = | |
{ message = "Hello world!" } | |
actions : Signal.Mailbox Action | |
actions = | |
Signal.mailbox NoOp | |
update : Action -> Model -> Model | |
update action model = | |
case action of | |
NoOp -> model | |
model = | |
Signal.foldp update init actions.signal | |
main = | |
Signal.map (view actions.address) model | |
view address model = | |
div [] [ text model.message ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment