I end up using this OutMsg pattern:
Main.elm
type Msg =
GlobalMsg Global.Msg
-- ...
And add some return helpers to simplify tuple building:
Global.elm
type Msg =
-- ...
return : model -> ( model, Cmd msg, Cmd Msg )
return model =
( model, Cmd.none, Cmd.none )
return2 : model -> Cmd msg -> ( model, Cmd msg, Cmd Msg )
return2 model cmd =
( model, cmd, Cmd.none )