@@ -508,41 +508,30 @@ reasonToString reason =
508 go "Only strings and lists are both comparable and appendable."
508 go "Only strings and lists are both comparable and appendable."
510 BadVar (Just (Rigid _)) (Just (Rigid _)) ->
510 BadVar (Just (Rigid _)) (Just (Rigid _)) ->
511− Just $ Help.stack $
511+ go doubleRigidError
512− [ hintDoc <> text "This usually happens when a few factors come together."
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."
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."
523− BadVar (Just (Rigid (Just name))) _ ->
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."
531 BadVar (Just (Rigid _)) _ ->
513 BadVar (Just (Rigid _)) _ ->
532− go genericRigidError
514+ go singleRigidError
534 BadVar _ (Just (Rigid _)) ->
516 BadVar _ (Just (Rigid _)) ->
535− go genericRigidError
517+ go singleRigidError
537 BadVar _ _ ->
519 BadVar _ _ ->
541−genericRigidError :: String
523+singleRigidError :: String
542−genericRigidError =
524+singleRigidError =
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\
525+ "A type annotation is too generic. You can probably just switch to the\
545− \ can be given, but the other needs a more specific type."
526+ \ type I inferred. These issues can be subtle though, so read more about it. "
527+ ++ Help.hintLink "type-annotations"
530+doubleRigidError :: String
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"
548hintDoc :: Doc
537hintDoc :: Doc