Created
October 2, 2016 12:58
-
-
Save joonazan/8fd22a3ef44044037cea78b2434d5c50 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
module Child exposing (init, update, Message) | |
init = 0 | |
type Message | |
= InterestingMessage | |
| InternalMessage | |
update message model = model |
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 | |
import Html.App | |
import Child | |
main = Html.App.beginnerProgram | |
{ update = update | |
, model = Child.init | |
, view = \model -> Html.text "hello" | |
} | |
type Message | |
= MyMessage | |
| ChildMessage Child.Message | |
type IMSG = Child.InterestingMessage -- Commenting out this line changes the behaviour of the program | |
update message model = | |
case message of | |
MyMessage -> model | |
--ChildMessage IMSG -> 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