Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
This module contains a single function that converts a RType -> Doc without using *any* simplifications.
Synopsis
- type OkRT c tv r = (TyConable c, PPrint tv, PPrint c, PPrint r, Reftable r, Reftable (RTProp c tv ()), Reftable (RTProp c tv r), Eq c, Eq tv, Hashable tv)
- rtypeDoc :: OkRT c tv r => Tidy -> RType c tv r -> Doc
- pprManyOrdered :: (PPrint a, Ord a) => Tidy -> String -> [a] -> [Doc]
- pprintLongList :: PPrint a => Tidy -> [a] -> Doc
- pprintSymbol :: Symbol -> Doc
- printWarning :: Logger -> DynFlags -> Warning -> IO ()
- data Filter
- getFilters :: Config -> [Filter]
- reduceFilters :: (e -> String) -> [Filter] -> e -> [Filter]
- defaultFilterReporter :: FilePath -> [Filter] -> TcRn ()
- data FilterReportErrorsArgs m filter msg e a = FilterReportErrorsArgs {
- msgReporter :: [msg] -> m ()
- filterReporter :: [filter] -> m ()
- failure :: m a
- continue :: m a
- pprinter :: e -> m msg
- matchingFilters :: e -> [filter]
- filters :: [filter]
- filterReportErrorsWith :: (Monad m, Ord filter) => FilterReportErrorsArgs m filter msg e a -> [e] -> m a
- filterReportErrors :: forall e' a. (Show e', PPrint e') => FilePath -> TcRn a -> TcRn a -> [Filter] -> Tidy -> [TError e'] -> TcRn a
Printable RTypes
type OkRT c tv r = (TyConable c, PPrint tv, PPrint c, PPrint r, Reftable r, Reftable (RTProp c tv ()), Reftable (RTProp c tv r), Eq c, Eq tv, Hashable tv) Source #
Printers
Printing Lists (TODO: move to fixpoint)
pprintSymbol :: Symbol -> Doc Source #
Printing diagnostics
printWarning :: Logger -> DynFlags -> Warning -> IO () Source #
Printing Warnings ---------------------------------------------------------
Filtering errors
Filter
s match errors. They are used to ignore classes of errors they
match. AnyFilter
matches all errors. StringFilter
matches any error whose
"representation" contains the given String
. A "representation" is
pretty-printed String of the error.
reduceFilters :: (e -> String) -> [Filter] -> e -> [Filter] Source #
Return the list of filters
that matched the err
, given a renderer
for the err
and some filters
defaultFilterReporter :: FilePath -> [Filter] -> TcRn () Source #
Report errors via GHC's API stating the given Filter
s did not get
matched. Does nothing if the list of filters is empty.
Reporting errors in the typechecking phase
data FilterReportErrorsArgs m filter msg e a Source #
Used in filterReportErrorsWith
`
FilterReportErrorsArgs | |
|
filterReportErrorsWith :: (Monad m, Ord filter) => FilterReportErrorsArgs m filter msg e a -> [e] -> m a Source #
Calls the continuations in FilterReportErrorsArgs depending on whethere there are unmatched errors, unmatched filters or none.
filterReportErrors :: forall e' a. (Show e', PPrint e') => FilePath -> TcRn a -> TcRn a -> [Filter] -> Tidy -> [TError e'] -> TcRn a Source #
Pretty-printing errors ----------------------------------------------------
Similar in spirit to reportErrors
from the GHC API, but it uses our
pretty-printer and shim functions under the hood. Also filters the errors
according to the given Filter
list.
filterReportErrors failure continue filters k
will call failure
if there
are unexpected errors, or will call continue
otherwise.
An error is expected if there is any filter that matches it.