on master help sign in
Improve type error for mismatched entries in list literal

Fixes https://github.com/elm-lang/error-message-catalog/issues/90 in combination with the https://github.com/elm-lang/error-message-catalog/issues/137 improvements.

commit267f708a435724fabe531ff116250d08033da5b1 authorEvan Czaplicki <evancz@users.noreply.github.com> dateTue 9 Aug 2016, 21:39 (10 years ago) parentd5f706f
1 file changed+6−4
src/Reporting/Error/Type.hs+6−4
src/Reporting/Error/Type.hs+6−4
@@ -230,12 +230,14 @@ mismatchToReport localizer (MismatchInfo hint leftType rightType maybeReason) =
230230 ListElement elementNumber region ->
231231 report
232232 (Just region)
233− ("The " ++ ordinalPair elementNumber ++ " elements are different types of values.")
233+ ("The " ++ ordinalPair elementNumber ++ " entries in this list are different types of values.")
234234 ( cmpHint
235− ("The " ++ Help.ordinalize (elementNumber - 1) ++ " element has this type:")
235+ ("The " ++ Help.ordinalize (elementNumber - 1) ++ " entry has this type:")
236236 ("But the "++ Help.ordinalize elementNumber ++ " is:")
237− [ "All elements should be the same type of value so that we can\
238− \ iterate through the list without running into unexpected values."
237+ [ "Every entry in a list needs to be the same type of value.\
238+ \ This way you never run into unexpected values partway through.\
239+ \ To mix different types in a single list, create a \"union type\" as\
240+ \ described in: <http://guide.elm-lang.org/types/union_types.html>"
239241 ]
240242 )
241243