Sure, you can imagine turning a Html Msg into a Cmd Msg but if you do that
you lose the information that makes it a Html Msg.

If the children of a div could be any Cmd Msg, you could put an Http
request there and it would type check but what would that mean?

You can look at it like you would look at a measurement unit type.

type Meter = Meter Float.

Sure, you could just use Float but if you want to make sure that only
Meters can be taken as arguments, you need the extra type.




On Wed, Aug 10, 2016 at 4:24 PM, Charlie Koster <ckoste...@gmail.com> wrote:

> I can speculate as to why DOM side effects are different than all other
> side effects. But when explaining the Elm architecture to a friend I
> explained it like this:
>
>    - Elm apps take in a model and a Msg as inputs and run those two
>    inputs through an update function
>    - The update function returns a new model as well as a list of Cmd Msg
>    - The resulting model is then sent into your view function which in
>    turn returns an Html Msg
>    - To summarize that, your Elm app returns a new model, an Html Msg,
>    and a list of Cmd Msg everytime it receives a new Msg as input
>    - Any commands returned from the app are descriptions of side effects
>    (such as perform an Http request) and Elm takes care of that
>    - Any html returned from the app are descriptions of side effects to
>    the DOM specifically and Elm takes care of that as well
>
> However, I couldn't find any reasons on the spot why DOM side effects are
> special and literally all other side effect descriptions are grouped into a
> separate bucket called Cmd. My original assumption is that all Elm apps
> will have some kind of DOM so why not have a separate Html Msg construct?
> But I don't think that is a safe assumption if you're not using Elm for
> your view layer, or you using it in a NodeJS app.
>
> So, why aren't descriptions of DOM also bundled into the Cmd Msg bucket?
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.

Reply via email to