Safe Haskell | None |
---|---|
Language | Haskell98 |
This module exposes variations over the standard GHC's logging functions to work with the Doc
type from the "pretty" package. We would like LiquidHaskell to emit diagnostic messages using the very
same GHC machinery, so that IDE-like programs (e.g. "ghcid", "ghcide" etc) would be able to
correctly show errors and warnings to the users, in ther editors.
Unfortunately, this is not possible to do out of the box because LiquidHaskell uses the Doc
type from
the "pretty" package but GHC uses (for historical reasons) its own version. Due to the fact none of
the constructors are exported, we simply cannot convert between the two types effortlessly, but we have
to pay the price of a pretty-printing "roundtrip".
Synopsis
- fromPJDoc :: Doc -> SDoc
- putLogMsg :: DynFlags -> WarnReason -> Severity -> SrcSpan -> Maybe PprStyle -> Doc -> IO ()
- putWarnMsg :: DynFlags -> SrcSpan -> Doc -> IO ()
- putErrMsg :: DynFlags -> SrcSpan -> Doc -> IO ()
- putErrMsg' :: DynFlags -> SrcSpan -> SDoc -> IO ()
- mkLongErrAt :: SrcSpan -> Doc -> Doc -> TcRn ErrMsg
Documentation
putLogMsg :: DynFlags -> WarnReason -> Severity -> SrcSpan -> Maybe PprStyle -> Doc -> IO () #
Like the original putLogMsg
, but internally converts the input Doc
(from the "pretty" library)
into GHC's internal SDoc
.
putErrMsg' :: DynFlags -> SrcSpan -> SDoc -> IO () #
Like putErrMsg
, but it uses GHC's internal Doc
. This can be very convenient when logging things
which comes directly from GHC rather than LiquidHaskell.
mkLongErrAt :: SrcSpan -> Doc -> Doc -> TcRn ErrMsg #
Like GHC's mkLongErrAt
, but it builds the final ErrMsg
out of two "HughesPJ"'s Doc
s.