I’m learing Elm and trying to understand how type annotations for generic functions are written. (Not sure “generic function” this is the right term for this in Elm, please advise.)
Given the following code:
import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) type Msg = EmailChanged String | PasswordChanged String formView label msg = div  [text (label ++ ": "), input [onInput msg] ] main = div  [formView "Email" EmailChanged, formView "Password" PasswordChanged]
What is the reasoning behind the
formView function being annotated like this
formView : String -> (String -> msg) -> Html msg
and what is the reasoning behind this annotation for the function not being right?
formView : String -> msg -> Html Msg