# Html Msg vs Html msg?

**URL:** <https://discourse.elm-lang.org/t/html-msg-vs-html-msg/2758>\
**Category:** Learn\
**Created:** [December 13, 2018, 4:19pm UTC](https://discourse.elm-lang.org/t/html-msg-vs-html-msg/2758 "2018-12-13T16:19:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![joelq](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/joelq/32/445_2.png) [@joelq](https://discourse.elm-lang.org/u/joelq)\
**Post date:** [December 13, 2018, 6:39pm UTC](https://discourse.elm-lang.org/t/html-msg-vs-html-msg/2758/4 "2018-12-13T18:39:38Z")

</div>

I think part of the confusion here is that there are two different things referred to as “message” in the Elm community.

1. The generic idea of a value that represents an event in the outside world and that will eventually feed into your update function. It shows up as a type variable in several types where it is conventionally written as little “m” `msg` (e.g. `Html msg`, `Cmd msg`)
2. A user-defined custom type named big “M” `Msg`

While there’s often a lot of overlap between the two, they are not the same. `Msg` isn’t a “magic” framework type and types like `Html String` or `Html Int` are valid. More subtly, larger projects such as [elm-spa-example](https://github.com/rtfeldman/elm-spa-example) often have view functions that return values like `Html Home.Msg` or `Html Article.Msg`

While the lowercase `msg` variable name has good intentions of communicating _“the type that would go here fills the role of a message (definition 1)”_, my experience is that many people read it as _“the type that would go here is going to be a `Msg` (definition 2)”_.

Personally, I’ve started using `Html a` in my own code rather than `Html msg` to avoid this confusion 🙂

---

_[View the full topic](https://discourse.elm-lang.org/t/html-msg-vs-html-msg/2758)._
