I don't fully understand your explanation but that is in part due to my 
ignorance of the underlying implementation of both Cmd and Html.

Let's see if we can discuss at a more conceptual level. Here is a snippet 
from the Elm examples page:

getRandomGif : String -> Cmd Msg
getRandomGif topic =
  let
    url =
      "https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag="; ++ 
topic
  in
    Task.perform FetchFail FetchSucceed (Http.get decodeGifUrl url)

To me, if the Cmd Msg that is returned from getRandomGif can perform and 
Http request and send one message on failure and send a different message 
on success (I don't know if "send' is the right verb), then I'm not 
understanding why something similar couldn't be done for the DOM.

Performing an HTTP request is a side effect. Manipulating the DOM is also a 
side effect. In both cases, side effects are happening and in both cases 
one message may get "fired" because of some outside interaction either from 
the user or from the server.

I hope that helps clarify why it's hard for me to see DOM manipulation side 
effects as a special case.

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