Re: [elm-discuss] combining union types

2016-07-01 Thread Janis Voigtländer
No. You can only do to Msg what you already did to PageMsg and LibMsg (through 
tagging *their* message "subtypes").

> Am 01.07.2016 um 11:43 schrieb jonathan de montalembert :
> 
> Is there a way to combine two Msg into one? Like (not working)
> 
>> type PageMsg
>>   = HomeMsg Home.Msg
>>   | ArchiveMsg Archive.Msg
>  
>> type LibMsg 
>>   = TranslationMsg Translation.Msg
>>   | PhoenixMsg Phoenix.Msg
>  
>> type Msg
>>   = PageMsg
>>   | LibMsg
> 
> then have 
> 
>> update: Msg -> Model -> (Model, Cmd Msg)
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] combining union types

2016-07-01 Thread jonathan de montalembert
Is there a way to combine two Msg into one? Like (not working)

type PageMsg
>   = HomeMsg Home.Msg
>   | ArchiveMsg Archive.Msg
>
 

> type LibMsg 
>   = TranslationMsg Translation.Msg
>   | PhoenixMsg Phoenix.Msg
>
 

> type Msg
>   = PageMsg
>   | LibMsg


then have 

update: Msg -> Model -> (Model, Cmd Msg)



-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.