title: Elm: How to transform Html FooMsg to Html Msg
body: <p>I'm new to Elm. I have a site with two pages: Home and Signup.</p>
  
  <p>Home has it's own view and Signup has it's own view, but they both return <code>Html Msg</code>. I'd like to change it so that Home returns <code>Html HomeMsg</code> and Signup returns <code>Html SignupMsg</code>. </p>
  
  <p>Writing these view functions is easy of course, but I think my top-level view function needs to transform the result into <code>Html Msg</code>.</p>
  
  <p>Here is the Msg type.</p>
  
  <pre><code>type Msg 
    = Home HomeMsg
    | Signup SignupMsg
    | OnLocationChange Location
  </code></pre>
  
  <p>I think I need some sort of <code>map</code> function to do this like</p>
  
  <pre><code>view : Model -&gt; Html Msg 
  view model =
      case model.route of
          Model.HomeRoute -&gt;
              map Home (homeView model)
  
          Model.SignupRoute -&gt;
              map Signup (signupView model)
  
          Model.NotFoundRoute -&gt;
              notFoundView
  </code></pre>