Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data GhcMessage where
- GhcPsMessage :: PsMessage -> GhcMessage
- GhcTcRnMessage :: TcRnMessage -> GhcMessage
- GhcDsMessage :: DsMessage -> GhcMessage
- GhcDriverMessage :: DriverMessage -> GhcMessage
- GhcUnknownMessage :: forall a. (Diagnostic a, Typeable a) => a -> GhcMessage
- data DriverMessage where
- DriverUnknownMessage :: (Diagnostic a, Typeable a) => a -> DriverMessage
- DriverPsHeaderMessage :: !PsMessage -> DriverMessage
- DriverMissingHomeModules :: UnitId -> [ModuleName] -> !BuildingCabalPackage -> DriverMessage
- DriverUnknownReexportedModules :: UnitId -> [ModuleName] -> DriverMessage
- DriverUnknownHiddenModules :: UnitId -> [ModuleName] -> DriverMessage
- DriverUnusedPackages :: [(UnitId, PackageName, Version, PackageArg)] -> DriverMessage
- DriverUnnecessarySourceImports :: !ModuleName -> DriverMessage
- DriverDuplicatedModuleDeclaration :: !Module -> [FilePath] -> DriverMessage
- DriverModuleNotFound :: !ModuleName -> DriverMessage
- DriverFileModuleNameMismatch :: !ModuleName -> !ModuleName -> DriverMessage
- DriverUnexpectedSignature :: !ModuleName -> !BuildingCabalPackage -> GenInstantiations UnitId -> DriverMessage
- DriverFileNotFound :: !FilePath -> DriverMessage
- DriverStaticPointersNotSupported :: DriverMessage
- DriverBackpackModuleNotFound :: !ModuleName -> DriverMessage
- DriverUserDefinedRuleIgnored :: !(RuleDecl GhcTc) -> DriverMessage
- DriverMixedSafetyImport :: !ModuleName -> DriverMessage
- DriverCannotLoadInterfaceFile :: !Module -> DriverMessage
- DriverInferredSafeModule :: !Module -> DriverMessage
- DriverMarkedTrustworthyButInferredSafe :: !Module -> DriverMessage
- DriverInferredSafeImport :: !Module -> DriverMessage
- DriverCannotImportUnsafeModule :: !Module -> DriverMessage
- DriverMissingSafeHaskellMode :: !Module -> DriverMessage
- DriverPackageNotTrusted :: !UnitState -> !UnitId -> DriverMessage
- DriverCannotImportFromUntrustedPackage :: !UnitState -> !Module -> DriverMessage
- DriverRedirectedNoMain :: !ModuleName -> DriverMessage
- DriverHomePackagesNotClosed :: ![UnitId] -> DriverMessage
- type DriverMessages = Messages DriverMessage
- data PsMessage = PsHeaderMessage !PsHeaderMessage
- data BuildingCabalPackage
- type WarningMessages = Messages GhcMessage
- type ErrorMessages = Messages GhcMessage
- type WarnMsg = MsgEnvelope GhcMessage
- ghcUnknownMessage :: (Diagnostic a, Typeable a) => a -> GhcMessage
- hoistTcRnMessage :: Monad m => m (Messages TcRnMessage, a) -> m (Messages GhcMessage, a)
- hoistDsMessage :: Monad m => m (Messages DsMessage, a) -> m (Messages GhcMessage, a)
- checkBuildingCabalPackage :: DynFlags -> BuildingCabalPackage
Documentation
data GhcMessage where Source #
The umbrella type that encompasses all the different messages that GHC might output during the different compilation stages. See Note [GhcMessage].
GhcPsMessage :: PsMessage -> GhcMessage | A message from the parsing phase. |
GhcTcRnMessage :: TcRnMessage -> GhcMessage | A message from typecheck/renaming phase. |
GhcDsMessage :: DsMessage -> GhcMessage | A message from the desugaring (HsToCore) phase. |
GhcDriverMessage :: DriverMessage -> GhcMessage | A message from the driver. |
GhcUnknownMessage :: forall a. (Diagnostic a, Typeable a) => a -> GhcMessage | An "escape" hatch which can be used when we don't know the source of
the message or if the message is not one of the typed ones. The
|
Instances
Diagnostic GhcMessage Source # | |
Defined in GHC.Driver.Errors.Ppr |
data DriverMessage where Source #
A message from the driver.
DriverUnknownMessage :: (Diagnostic a, Typeable a) => a -> DriverMessage | Simply wraps a generic |
DriverPsHeaderMessage :: !PsMessage -> DriverMessage | A parse error in parsing a Haskell file header during dependency analysis |
DriverMissingHomeModules :: UnitId -> [ModuleName] -> !BuildingCabalPackage -> DriverMessage | DriverMissingHomeModules is a warning (controlled with -Wmissing-home-modules) that arises when running GHC in --make mode when some modules needed for compilation are not included on the command line. For example, if A imports B, `ghc --make A.hs` will cause this warning, while `ghc --make A.hs B.hs` will not. Useful for cabal to ensure GHC won't pick up modules listed neither in 'exposed-modules' nor in 'other-modules'. Test case: warningsshould_compileMissingMod |
DriverUnknownReexportedModules :: UnitId -> [ModuleName] -> DriverMessage | DriverUnknown is a warning that arises when a user tries to reexport a module which isn't part of that unit. |
DriverUnknownHiddenModules :: UnitId -> [ModuleName] -> DriverMessage | DriverUnknownHiddenModules is a warning that arises when a user tries to hide a module which isn't part of that unit. |
DriverUnusedPackages :: [(UnitId, PackageName, Version, PackageArg)] -> DriverMessage | DriverUnusedPackages occurs when when package is requested on command line, but was never needed during compilation. Activated by -Wunused-packages. Test cases: warningsshould_compileUnusedPackages |
DriverUnnecessarySourceImports :: !ModuleName -> DriverMessage | DriverUnnecessarySourceImports (controlled with -Wunused-imports) occurs if there
are imports which are not necessary. See Test cases: warningsshould_compileT10637 |
DriverDuplicatedModuleDeclaration :: !Module -> [FilePath] -> DriverMessage | DriverDuplicatedModuleDeclaration occurs if a module Test cases: None. |
DriverModuleNotFound :: !ModuleName -> DriverMessage | DriverModuleNotFound occurs if a module Test cases: None. |
DriverFileModuleNameMismatch :: !ModuleName -> !ModuleName -> DriverMessage | DriverFileModuleNameMismatch occurs if a module Test cases: modulemod178, driver/bug1677 |
DriverUnexpectedSignature :: !ModuleName -> !BuildingCabalPackage -> GenInstantiations UnitId -> DriverMessage | DriverUnexpectedSignature occurs when GHC encounters a module Example:
Test cases: driver/T12955 |
DriverFileNotFound :: !FilePath -> DriverMessage | DriverFileNotFound occurs when the input file (e.g. given on the command line) can't be found. Test cases: None. |
DriverStaticPointersNotSupported :: DriverMessage | DriverStaticPointersNotSupported occurs when the Test cases: ghciscriptsStaticPtr |
DriverBackpackModuleNotFound :: !ModuleName -> DriverMessage | DriverBackpackModuleNotFound occurs when Backpack can't find a particular module during its dependency analysis. Test cases: - |
DriverUserDefinedRuleIgnored :: !(RuleDecl GhcTc) -> DriverMessage | DriverUserDefinedRuleIgnored is a warning that occurs when user-defined rules are ignored. This typically happens when Safe Haskell. Test cases: testssafeHaskellsafeInfered/UnsafeWarn05 testssafeHaskellsafeInfered/UnsafeWarn06 testssafeHaskellsafeInfered/UnsafeWarn07 testssafeHaskellsafeInfered/UnsafeInfered11 testssafeHaskellsafeLanguage/SafeLang03 |
DriverMixedSafetyImport :: !ModuleName -> DriverMessage | DriverMixedSafetyImport is an error that occurs when a module is imported both as safe and unsafe. Test cases: testssafeHaskellsafeInfered/Mixed03 testssafeHaskellsafeInfered/Mixed02 |
DriverCannotLoadInterfaceFile :: !Module -> DriverMessage | DriverCannotLoadInterfaceFile is an error that occurs when we cannot load the interface file for a particular module. This can happen for example in the context of Safe Haskell, when we have to load a module to check if it can be safely imported. Test cases: None. |
DriverInferredSafeModule :: !Module -> DriverMessage | DriverInferredSafeImport is a warning (controlled by the Opt_WarnSafe flag) that occurs when a module is inferred safe. Test cases: None. |
DriverMarkedTrustworthyButInferredSafe :: !Module -> DriverMessage | DriverMarkedTrustworthyButInferredSafe is a warning (controlled by the Opt_WarnTrustworthySafe flag) that occurs when a module is marked trustworthy in SafeHaskell but it has been inferred safe. Test cases: testssafeHaskellsafeInfered/TrustworthySafe02 testssafeHaskellsafeInfered/TrustworthySafe03 |
DriverInferredSafeImport :: !Module -> DriverMessage | DriverInferredSafeImport is a warning (controlled by the Opt_WarnInferredSafeImports flag) that occurs when a safe-inferred module is imported from a safe module. Test cases: None. |
DriverCannotImportUnsafeModule :: !Module -> DriverMessage | DriverCannotImportUnsafeModule is an error that occurs when an usafe module is being imported from a safe one. Test cases: None. |
DriverMissingSafeHaskellMode :: !Module -> DriverMessage | DriverMissingSafeHaskellMode is a warning (controlled by the Opt_WarnMissingSafeHaskellMode flag) that occurs when a module is using SafeHaskell features but SafeHaskell mode is not enabled. Test cases: None. |
DriverPackageNotTrusted :: !UnitState -> !UnitId -> DriverMessage | DriverPackageNotTrusted is an error that occurs when a package is required to be trusted but it isn't. Test cases: testssafeHaskellcheck/Check01 testssafeHaskellcheck/Check08 testssafeHaskellcheck/Check06 testssafeHaskellcheckpkg01ImpSafeOnly09 testssafeHaskellcheckpkg01ImpSafe03 testssafeHaskellcheckpkg01ImpSafeOnly07 testssafeHaskellcheckpkg01ImpSafeOnly08 |
DriverCannotImportFromUntrustedPackage :: !UnitState -> !Module -> DriverMessage | DriverCannotImportFromUntrustedPackage is an error that occurs in the context of Safe Haskell when trying to import a module coming from an untrusted package. Test cases: testssafeHaskellcheck/Check09 testssafeHaskellcheckpkg01ImpSafe01 testssafeHaskellcheckpkg01ImpSafe04 testssafeHaskellcheckpkg01ImpSafeOnly03 testssafeHaskellcheckpkg01ImpSafeOnly05 testssafeHaskellflags/SafeFlags17 testssafeHaskellflags/SafeFlags22 testssafeHaskellflags/SafeFlags23 testssafeHaskellghci/p11 testssafeHaskellghci/p12 testssafeHaskellghci/p17 testssafeHaskellghci/p3 testssafeHaskellsafeInfered/UnsafeInfered01 testssafeHaskellsafeInfered/UnsafeInfered02 testssafeHaskellsafeInfered/UnsafeInfered02 testssafeHaskellsafeInfered/UnsafeInfered03 testssafeHaskellsafeInfered/UnsafeInfered05 testssafeHaskellsafeInfered/UnsafeInfered06 testssafeHaskellsafeInfered/UnsafeInfered09 testssafeHaskellsafeInfered/UnsafeInfered10 testssafeHaskellsafeInfered/UnsafeInfered11 testssafeHaskellsafeInfered/UnsafeWarn01 testssafeHaskellsafeInfered/UnsafeWarn03 testssafeHaskellsafeInfered/UnsafeWarn04 testssafeHaskellsafeInfered/UnsafeWarn05 testssafeHaskellunsafeLibs/BadImport01 testssafeHaskellunsafeLibs/BadImport06 testssafeHaskellunsafeLibs/BadImport07 testssafeHaskellunsafeLibs/BadImport08 testssafeHaskellunsafeLibs/BadImport09 testssafeHaskellunsafeLibs/Dep05 testssafeHaskellunsafeLibs/Dep06 testssafeHaskellunsafeLibs/Dep07 testssafeHaskellunsafeLibs/Dep08 testssafeHaskellunsafeLibs/Dep09 testssafeHaskellunsafeLibs/Dep10 |
DriverRedirectedNoMain :: !ModuleName -> DriverMessage | |
DriverHomePackagesNotClosed :: ![UnitId] -> DriverMessage |
Instances
type DriverMessages = Messages DriverMessage Source #
A collection of driver messages
PsHeaderMessage !PsHeaderMessage | A group of parser messages emitted in |
Instances
Diagnostic PsMessage Source # | |
Defined in GHC.Parser.Errors.Ppr |
data BuildingCabalPackage Source #
Pass to a DriverMessage
the information whether or not the
'-fbuilding-cabal-package' flag is set.
Instances
Eq BuildingCabalPackage Source # | |
Defined in GHC.Driver.Errors.Types (==) :: BuildingCabalPackage -> BuildingCabalPackage -> Bool # (/=) :: BuildingCabalPackage -> BuildingCabalPackage -> Bool # |
type WarningMessages = Messages GhcMessage Source #
A collection of warning messages.
INVARIANT: Each GhcMessage
in the collection should have SevWarning
severity.
type ErrorMessages = Messages GhcMessage Source #
A collection of error messages.
INVARIANT: Each GhcMessage
in the collection should have SevError
severity.
type WarnMsg = MsgEnvelope GhcMessage Source #
A single warning message.
INVARIANT: It must have SevWarning
severity.
Constructors
ghcUnknownMessage :: (Diagnostic a, Typeable a) => a -> GhcMessage Source #
Creates a new GhcMessage
out of any diagnostic. This function is also
provided to ease the integration of #18516 by allowing diagnostics to be
wrapped into the general (but structured) GhcMessage
type, so that the
conversion can happen gradually. This function should not be needed within
GHC, as it would typically be used by plugin or library authors (see
comment for the GhcUnknownMessage
type constructor)
Utility functions
hoistTcRnMessage :: Monad m => m (Messages TcRnMessage, a) -> m (Messages GhcMessage, a) Source #
Abstracts away the frequent pattern where we are calling ioMsgMaybe
on
the result of 'IO (Messages TcRnMessage, a)'.
hoistDsMessage :: Monad m => m (Messages DsMessage, a) -> m (Messages GhcMessage, a) Source #
Abstracts away the frequent pattern where we are calling ioMsgMaybe
on
the result of 'IO (Messages DsMessage, a)'.
checkBuildingCabalPackage :: DynFlags -> BuildingCabalPackage Source #
Checks if we are building a cabal package by consulting the DynFlags
.