LoginSignup
5
0

More than 5 years have passed since last update.

わーい、すごーい

Posted at
import Html exposing (Html, text)


main =
  Html.beginnerProgram { model = model, view = view, update = update }


type alias Model = String


model : Model
model =
  ""
    |> update Wai
    |> update Sugoi
    |> update Tanoshii
    |> update (Friends "クソリプ")


type Msg
    = Wai
    | Sugoi
    | Tanoshii
    | Friends String


update : Msg -> Model -> Model
update msg model =
  case msg of
    Wai ->
        model ++ "わーい"

    Sugoi ->
        model ++ "すごーい"

    Tanoshii ->
        model ++ "たのしー"

    Friends skill ->
        model ++ "君は" ++ skill ++ "がとくいな、フレンズなんだね!!"


view : Model -> Html Msg
view model = text model

Try Elm

元ネタ
http://qiita.com/t_ishida/items/bae7e62950d81f427f13

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0