Created
October 2, 2016 13:59
-
-
Save joonazan/ff11424018eca413ac9288fb57ac1d48 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 Child exposing (init, update, Message(InterestingMessage)) | |
init = 0 | |
type Message | |
= InterestingMessage | |
| InternalMessage | |
update message model = model |
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
import Html | |
import Html.App | |
import Child exposing (Message(..)) | |
main = Html.App.beginnerProgram | |
{ update = update | |
, model = Child.init | |
, view = \model -> Html.text "hello" | |
} | |
type Message | |
= MyMessage | |
| ChildMessage Child.Message | |
update message model = | |
case message of | |
MyMessage -> model | |
ChildMessage InterestingMessage -> model | |
ChildMessage x -> Child.update x model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment