on master help sign in
Improve message for unbound type vars a bit
d5da02eEvan Czaplicki
src/Reporting/Error/Syntax.hs+5−5
@@ -122,11 +122,11 @@ unboundTypeVars typeName tvar tvars revisedDeclaration =
122 ++ "type errors possible. Unbound type variables include: "
122 ++ "type errors possible. Unbound type variables include: "
123 ++ List.intercalate ", " (tvar:tvars)
123 ++ List.intercalate ", " (tvar:tvars)
124 )
124 )
125+ ( "You probably want this definition instead:\n"
126+ ++ concatMap ("\n "++) (lines revisedDeclaration) ++ "\n\n"
125− ( "Here's the problem. Imagine one '" ++ typeName ++ "' where '" ++ tvar ++ "' is an Int and\n"
127+ ++ "Here's why. 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"
128+ ++ "another where it is a Bool. When we explicitly list the type variables, type\n"
127− ++ "checker, but they are actually different types!\n\n"
129+ ++ "checker can see that they are actually different types."
128− ++ "Maybe you want a definition like this?\n"
129− ++ concatMap ("\n "++) (lines revisedDeclaration)
130 )
130 )
131
131
132
132