Elm has parametric polymorphism so, functions can work over types that have one or more type variables. The type variables are unrestricted BUT, there are three restricted type variables: number, comparable, appendable. For example, `number` is restricted to Float and Int.
Maybe it is easier to understand the type of main as one of these restricted type variables that is restricted to `Html a` and `Program a`. On Sun, Jul 24, 2016 at 8:58 AM, Duane Johnson <[email protected]> wrote: > I was working through Elm in Action (first 2 chapters) today and I > realized I don't understand how `main` can be of type `Html.Html`: > > main = >> div [ class "content" ] [ text "Photo Groove" ] > > > In the documentation for `Platform > <http://package.elm-lang.org/packages/elm-lang/core/4.0.3/Platform#Program>` > it says: > > Every Elm project will define main to be some sort of `Program`. > > > Is `Html.Html` a kind of `Program`? Is there some kind of magic going on > here? Thanks! > > Duane > > -- > 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 [email protected]. > 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
