@@ -508,41 +508,30 @@ reasonToString reason =
508508 go "Only strings and lists are both comparable and appendable."
509509
510510 BadVar (Just (Rigid _)) (Just (Rigid _)) ->
511− Just $ Help.stack $
512− [ hintDoc <> text "This usually happens when a few factors come together."
513− , indent 4 $ vcat $
514− [ text "1. You have a generic function with a type annotation."
515− , text "2. In its definition, there is a `let` with generic type annotations."
516− ]
517− , Help.reflowParagraph
518− "The issue is that these type variables are not actually shared between\
519− \ outer and inner type annotations right now. You can usually fix this by\
520− \ commenting out the inner type annotations."
521− ]
522−
523− BadVar (Just (Rigid (Just name))) _ ->
524− go $
525− "Looks like the type annotation is too generic. Type variable\
526− \ `" ++ name ++ "` is saying *many* kinds of value can be given, but the\
527− \ actual definition needs a more specific type. I am not sure whether the\
528− \ type annotation or the definition is \"right\" though, you may have to\
529− \ make the annotation more specific or make the definition more generic."
511+ go doubleRigidError
530512
531513 BadVar (Just (Rigid _)) _ ->
532− go genericRigidError
514+ go singleRigidError
533515
534516 BadVar _ (Just (Rigid _)) ->
535− go genericRigidError
517+ go singleRigidError
536518
537519 BadVar _ _ ->
538520 Nothing
539521
540522
541−genericRigidError :: String
542−genericRigidError =
543− "There is some problem with a rigid type variable. It is very likely that a\
544− \ type annotation is too generic. One type is saying *many* kinds of value\
545− \ can be given, but the other needs a more specific type."
523+singleRigidError :: String
524+singleRigidError =
525+ "A type annotation is too generic. You can probably just switch to the\
526+ \ type I inferred. These issues can be subtle though, so read more about it. "
527+ ++ Help.hintLink "type-annotations"
528+
529+
530+doubleRigidError :: String
531+doubleRigidError =
532+ "A type annotation is clashing with itself or with a sub-annotation.\
533+ \ This can be particularly tricky, so read more about it. "
534+ ++ Help.hintLink "type-annotations"
546535
547536
548537hintDoc :: Doc