Capitalization mistakes
I saw this in #beginners on Elm Slack:
what am i doing wrong here - says that I have a naming error
Cannot find pattern OK
They used OK instead of Ok. At a glance, I can see how someone might look at their code and look at the suggestion of Did you mean "Ok"? and not spot the distinction.
Hints could detect when one of the suggestions matches what you typed exactly, except for capitalization (e.g. with if String.toLower actual == String.toLower suggestion) and call this out. Something like:
Did you mean:
Ok(Note the different capitalization fromOK)OkraOctopus
Related to this. Capitalization mistakes in records produce unhelpful error messages. Someone using elm-ui got stuck with this error and it took me several minutes before I noticed onchange should be onChange
This argument is a record of type:
{ checked : Bool
, icon : Bool -> Element msg1
, label : Label msg
, onchange : Bool -> Msg
}
But `checkbox` needs the 2nd argument to be:
{ checked : Bool
, icon : Bool -> Element msg
, label : Label msg
, onChange : Bool -> msg
}