ghc-7.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

ErrUtils

Synopsis

- type MsgDoc = SDoc
- data Validity
  - = IsValid
  - | NotValid MsgDoc
- andValid :: Validity -> Validity -> Validity
- allValid :: [Validity] -> Validity
- isValid :: Validity -> Bool
- getInvalids :: [Validity] -> [MsgDoc]
- data ErrMsg
- type WarnMsg = ErrMsg
- data Severity
  - = SevOutput
  - | SevDump
  - | SevInteractive
  - | SevInfo
  - | SevWarning
  - | SevError
  - | SevFatal
- type Messages = (WarningMessages, ErrorMessages)
- type ErrorMessages = Bag ErrMsg
- type WarningMessages = Bag WarnMsg
- errMsgSpan :: ErrMsg -> SrcSpan
- errMsgContext :: ErrMsg -> PrintUnqualified
- errMsgShortDoc :: ErrMsg -> MsgDoc
- errMsgExtraInfo :: ErrMsg -> MsgDoc
- mkLocMessage :: Severity -> SrcSpan -> MsgDoc -> MsgDoc
- pprMessageBag :: Bag MsgDoc -> SDoc
- pprErrMsgBag :: Bag ErrMsg -> [SDoc]
- pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
- pprLocErrMsg :: ErrMsg -> SDoc
- makeIntoWarning :: ErrMsg -> ErrMsg
- isWarning :: ErrMsg -> Bool
- errorsFound :: DynFlags -> Messages -> Bool
- emptyMessages :: Messages
- isEmptyMessages :: Messages -> Bool
- mkErrMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> ErrMsg
- mkPlainErrMsg :: DynFlags -> SrcSpan -> MsgDoc -> ErrMsg
- mkLongErrMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> MsgDoc -> ErrMsg
- mkWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> ErrMsg
- mkPlainWarnMsg :: DynFlags -> SrcSpan -> MsgDoc -> ErrMsg
- printBagOfErrors :: DynFlags -> Bag ErrMsg -> IO ()
- warnIsErrorMsg :: DynFlags -> ErrMsg
- mkLongWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> MsgDoc -> ErrMsg
- ghcExit :: DynFlags -> Int -> IO ()
- doIfSet :: Bool -> IO () -> IO ()
- doIfSet_dyn :: DynFlags -> GeneralFlag -> IO () -> IO ()
- dumpIfSet :: DynFlags -> Bool -> String -> SDoc -> IO ()
- dumpIfSet_dyn :: DynFlags -> DumpFlag -> String -> SDoc -> IO ()
- dumpIfSet_dyn_printer :: PrintUnqualified -> DynFlags -> DumpFlag -> SDoc -> IO ()
- mkDumpDoc :: String -> SDoc -> SDoc
- dumpSDoc :: DynFlags -> PrintUnqualified -> DumpFlag -> String -> SDoc -> IO ()
- putMsg :: DynFlags -> MsgDoc -> IO ()
- printInfoForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO ()
- printOutputForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO ()
- logInfo :: DynFlags -> PprStyle -> MsgDoc -> IO ()
- logOutput :: DynFlags -> PprStyle -> MsgDoc -> IO ()
- errorMsg :: DynFlags -> MsgDoc -> IO ()
- warningMsg :: DynFlags -> MsgDoc -> IO ()
- fatalErrorMsg :: DynFlags -> MsgDoc -> IO ()
- fatalErrorMsg' :: LogAction -> DynFlags -> MsgDoc -> IO ()
- fatalErrorMsg'' :: FatalMessager -> String -> IO ()
- compilationProgressMsg :: DynFlags -> String -> IO ()
- showPass :: DynFlags -> String -> IO ()
- debugTraceMsg :: DynFlags -> Int -> MsgDoc -> IO ()
- prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a

# Documentation

type MsgDoc = SDoc Source

data Validity Source

Constructors

IsValid |
NotValid MsgDoc |

andValid :: Validity -> Validity -> Validity Source

allValid :: [Validity] -> Validity Source

isValid :: Validity -> Bool Source

getInvalids :: [Validity] -> [MsgDoc] Source

data ErrMsg Source

Instances

Show ErrMsg |

type WarnMsg = ErrMsg Source

data Severity Source

Constructors

SevOutput |
SevDump |
SevInteractive |
SevInfo |
SevWarning |
SevError |
SevFatal |

type Messages = (WarningMessages, ErrorMessages) Source

type ErrorMessages = Bag ErrMsg Source

type WarningMessages = Bag WarnMsg Source

errMsgSpan :: ErrMsg -> SrcSpan Source

errMsgContext :: ErrMsg -> PrintUnqualified Source

errMsgShortDoc :: ErrMsg -> MsgDoc Source

errMsgExtraInfo :: ErrMsg -> MsgDoc Source

mkLocMessage :: Severity -> SrcSpan -> MsgDoc -> MsgDoc Source

pprMessageBag :: Bag MsgDoc -> SDoc Source

pprErrMsgBag :: Bag ErrMsg -> [SDoc] Source

pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc] Source

pprLocErrMsg :: ErrMsg -> SDoc Source

makeIntoWarning :: ErrMsg -> ErrMsg Source

isWarning :: ErrMsg -> Bool Source

errorsFound :: DynFlags -> Messages -> Bool Source

emptyMessages :: Messages Source

isEmptyMessages :: Messages -> Bool Source

mkErrMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> ErrMsg Source

mkPlainErrMsg :: DynFlags -> SrcSpan -> MsgDoc -> ErrMsg Source

mkLongErrMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> MsgDoc -> ErrMsg Source

mkWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> ErrMsg Source

mkPlainWarnMsg :: DynFlags -> SrcSpan -> MsgDoc -> ErrMsg Source

printBagOfErrors :: DynFlags -> Bag ErrMsg -> IO () Source

warnIsErrorMsg :: DynFlags -> ErrMsg Source

mkLongWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> MsgDoc -> ErrMsg Source

ghcExit :: DynFlags -> Int -> IO () Source

doIfSet :: Bool -> IO () -> IO () Source

doIfSet_dyn :: DynFlags -> GeneralFlag -> IO () -> IO () Source

dumpIfSet :: DynFlags -> Bool -> String -> SDoc -> IO () Source

dumpIfSet_dyn :: DynFlags -> DumpFlag -> String -> SDoc -> IO () Source

a wrapper around `dumpSDoc`. First check whether the dump flag is set Do nothing if it is unset

dumpIfSet_dyn_printer :: PrintUnqualified -> DynFlags -> DumpFlag -> SDoc -> IO () Source

a wrapper around `dumpSDoc`. First check whether the dump flag is set Do nothing if it is unset

Unlike `dumpIfSet_dyn`, has a printer argument but no header argument

mkDumpDoc :: String -> SDoc -> SDoc Source

dumpSDoc :: DynFlags -> PrintUnqualified -> DumpFlag -> String -> SDoc -> IO () Source

Write out a dump. If --dump-to-file is set then this goes to a file. otherwise emit to stdout.

When hdr is empty, we print in a more compact format (no separators and blank lines)

The DumpFlag is used only to choose the filename to use if --dump-to-file is used; it is not used to decide whether to dump the output

putMsg :: DynFlags -> MsgDoc -> IO () Source

printInfoForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO () Source

printOutputForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO () Source

logInfo :: DynFlags -> PprStyle -> MsgDoc -> IO () Source

logOutput :: DynFlags -> PprStyle -> MsgDoc -> IO () Source

errorMsg :: DynFlags -> MsgDoc -> IO () Source

warningMsg :: DynFlags -> MsgDoc -> IO () Source

fatalErrorMsg :: DynFlags -> MsgDoc -> IO () Source

fatalErrorMsg' :: LogAction -> DynFlags -> MsgDoc -> IO () Source

fatalErrorMsg'' :: FatalMessager -> String -> IO () Source

compilationProgressMsg :: DynFlags -> String -> IO () Source

showPass :: DynFlags -> String -> IO () Source

debugTraceMsg :: DynFlags -> Int -> MsgDoc -> IO () Source

prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a Source