Created
September 30, 2018 17:32
-
-
Save sarasfox/38ce1b98a0340b7e336cf5e18594785d 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
module ArchitechedHello exposing (..) | |
import Browser exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
main = | |
Browser.sandbox { model = model, view = view, update = update} | |
type alias Model = | |
{text: String} | |
model : Model | |
model = | |
{text = "Hello world"} | |
type Msg | |
= Text String | |
update : Msg -> Model -> Model | |
update msg model = | |
case msg of | |
Text txt -> | |
{model | text = model.text ++ "!"} | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ div [] [text model.text] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment