on master help sign in
Improve message for unbound type vars a bit
commitd5da02ee313d60b9f6e6a7c9016ea966bd23d8de authorEvan Czaplicki <info@elm-lang.org> dateSat 9 May 2015, 10:54 (11 years ago) parent410ab22
1 file changed+5−5
src/Reporting/Error/Syntax.hs+5−5
src/Reporting/Error/Syntax.hs+5−5
@@ -122,11 +122,11 @@ unboundTypeVars typeName tvar tvars revisedDeclaration =
122122 ++ "type errors possible. Unbound type variables include: "
123123 ++ List.intercalate ", " (tvar:tvars)
124124 )
125− ( "Here's the problem. Imagine one '" ++ typeName ++ "' where '" ++ tvar ++ "' is an Int and\n"
126− ++ "another where it is a Bool. They both look like a '" ++ typeName ++ "' to the type\n"
127− ++ "checker, but they are actually different types!\n\n"
128− ++ "Maybe you want a definition like this?\n"
129− ++ concatMap ("\n "++) (lines revisedDeclaration)
125+ ( "You probably want this definition instead:\n"
126+ ++ concatMap ("\n "++) (lines revisedDeclaration) ++ "\n\n"
127+ ++ "Here's why. Imagine one '" ++ typeName ++ "' where '" ++ tvar ++ "' is an Int and\n"
128+ ++ "another where it is a Bool. When we explicitly list the type variables, type\n"
129+ ++ "checker can see that they are actually different types."
130130 )
131131
132132