title: How to iterate over a list in an Elm view?
body: <p>I am trying to add rectangles to an SVG using a view in Elm the following way:</p>
  
  <pre><code>view : Model -&gt; Html Msg
  view model =
    let
        log1 = Debug.log "Time: " model.time
        log2 = Debug.log "Coords: " model.coordinates
        rects = [ ("200", "200"), ("210","201"), ("220", "202") ]
    in
      svg
      [ width "700", height "700", viewBox "0 0 500 500" ]
          [ rect [ x "100", y "100", width "600", height "600", fill "gray" ] []
          , List.map (\ coord -&gt; (rect [ x (fst coord), y (snd coord), width "1", height "1", fill "black" ] [])) rects
          ]
  </code></pre>
  
  <p>Is there a way to get an VirtualDom.Node type out of the map instead of List?</p>
  
  <p>Error message:</p>
  
  <pre><code>    The 1st element has this type:
  
          VirtualDom.Node a
  
      But the 2nd is:
  
          List (Svg a)
  
  Hint: All elements should be the same type of value so that we can iterate
  through the list without running into unexpected values.
  </code></pre>