diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-05-10 16:01:14 +0200 |
---|---|---|
committer | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-05-10 16:35:04 +0200 |
commit | d8eacb6f9181193bb663d490d6baab26a34acec2 (patch) | |
tree | 92ae45cfd896694edae4c21c5c609ef8f1b57c8b /compiler/GHC/Types/Hint.hs | |
parent | f18b960814c06a6a15ca22f840da166028afef45 (diff) | |
download | haskell-wip/adinapoli-convert-ps-hints.tar.gz |
Add a bunch of SuggestExtension hintswip/adinapoli-convert-ps-hints
Diffstat (limited to 'compiler/GHC/Types/Hint.hs')
-rw-r--r-- | compiler/GHC/Types/Hint.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/GHC/Types/Hint.hs b/compiler/GHC/Types/Hint.hs index 81b5993e6d..d5ff205361 100644 --- a/compiler/GHC/Types/Hint.hs +++ b/compiler/GHC/Types/Hint.hs @@ -37,7 +37,11 @@ data GhcHint where SuggestAddWhitespaceAround :: GhcHint -- | Suggests using 'Type' from 'Data.Kind' instead of \"*\". SuggestUseDataKindType :: GhcHint - + -- | Suggests the correct syntax for a type signature declaration + SuggestTypeSignatureDeclaration :: GhcHint + -- | Suggests adding the \"qualified\" keyword in the correct position + -- when importing a module qualified. + SuggestAddQualifiedAfterModuleName :: GhcHint instance Outputable GhcHint where ppr = \case @@ -75,6 +79,10 @@ instance Outputable GhcHint where SuggestUseDataKindType -> text "Use" <+> quotes (text "Type") <+> text "from" <+> quotes (text "Data.Kind") <+> text "instead." + SuggestTypeSignatureDeclaration + -> text "Try using the form <variable> :: <type>" + SuggestAddQualifiedAfterModuleName + -> text "Suggested fix: place " <+> quotes (text "qualified") <+> text "after the module name." -- | An 'InstantiationSuggestion' for a '.hsig' file. This is generated -- by GHC in case of a 'DriverUnexpectedSignature' and suggests a way |