ghc-7.6.3: The GHC API

Safe Haskell | None

ErrUtils

Synopsis

- data ErrMsg
- type WarnMsg = ErrMsg
- data Severity
  - = SevOutput
  - | SevDump
  - | SevInfo
  - | SevWarning
  - | SevError
  - | SevFatal
- type Messages = (WarningMessages, ErrorMessages)
- type ErrorMessages = Bag ErrMsg
- type WarningMessages = Bag WarnMsg
- errMsgSpans :: ErrMsg -> [SrcSpan]
- errMsgContext :: ErrMsg -> PrintUnqualified
- errMsgShortDoc :: ErrMsg -> MsgDoc
- errMsgExtraInfo :: ErrMsg -> MsgDoc
- type MsgDoc = SDoc
- mkLocMessage :: Severity -> SrcSpan -> MsgDoc -> MsgDoc
- pprMessageBag :: Bag MsgDoc -> SDoc
- pprErrMsgBag :: Bag ErrMsg -> [SDoc]
- pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
- pprLocErrMsg :: ErrMsg -> SDoc
- makeIntoWarning :: ErrMsg -> ErrMsg
- 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 -> DynFlag -> IO () -> IO ()
- dumpIfSet :: DynFlags -> Bool -> String -> SDoc -> IO ()
- dumpIfSet_dyn :: DynFlags -> DynFlag -> String -> SDoc -> IO ()
- dumpIfSet_dyn_or :: DynFlags -> [DynFlag] -> String -> SDoc -> IO ()
- mkDumpDoc :: String -> SDoc -> SDoc
- dumpSDoc :: DynFlags -> DynFlag -> String -> SDoc -> IO ()
- putMsg :: DynFlags -> MsgDoc -> IO ()
- putMsgWith :: DynFlags -> PrintUnqualified -> MsgDoc -> IO ()
- errorMsg :: 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

data ErrMsg

Instances

Show ErrMsg |

type WarnMsg = ErrMsg

data Severity

Constructors

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

type Messages = (WarningMessages, ErrorMessages)

type ErrorMessages = Bag ErrMsg

type WarningMessages = Bag WarnMsg

errMsgSpans :: ErrMsg -> [SrcSpan]

errMsgContext :: ErrMsg -> PrintUnqualified

errMsgShortDoc :: ErrMsg -> MsgDoc

errMsgExtraInfo :: ErrMsg -> MsgDoc

type MsgDoc = SDoc

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

pprMessageBag :: Bag MsgDoc -> SDoc

pprErrMsgBag :: Bag ErrMsg -> [SDoc]

pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]

pprLocErrMsg :: ErrMsg -> SDoc

makeIntoWarning :: ErrMsg -> ErrMsg

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 -> DynFlag -> IO () -> IO ()

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

dumpIfSet_dyn :: DynFlags -> DynFlag -> String -> SDoc -> IO ()

dumpIfSet_dyn_or :: DynFlags -> [DynFlag] -> String -> SDoc -> IO ()

mkDumpDoc :: String -> SDoc -> SDoc

dumpSDoc :: DynFlags -> DynFlag -> String -> SDoc -> IO ()

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)

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

putMsgWith :: DynFlags -> PrintUnqualified -> MsgDoc -> IO ()

errorMsg :: 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