Copyright | (c) T. Mossakowski, C. Maeder, Uni Bremen 2002-2008 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
- data DiagKind
- data Diagnosis = Diag {}
- mkDiag :: (GetRange a, Pretty a) => DiagKind -> String -> a -> Diagnosis
- mkNiceDiag :: (GetRange a, Pretty a) => GlobalAnnos -> DiagKind -> String -> a -> Diagnosis
- isErrorDiag :: Diagnosis -> Bool
- hasErrors :: [Diagnosis] -> Bool
- addErrorDiag :: (GetRange a, Pretty a) => String -> a -> Result b -> Result b
- checkUniqueness :: (Pretty a, GetRange a, Ord a) => [a] -> [Diagnosis]
- data Result a = Result {
- diags :: [Diagnosis]
- maybeResult :: Maybe a
- appendDiags :: [Diagnosis] -> Result ()
- joinResultWith :: (a -> b -> c) -> Result a -> Result b -> Result c
- joinResult :: Result a -> Result b -> Result b
- mapR :: (a -> Result b) -> [a] -> Result [b]
- fatal_error :: String -> Range -> Result a
- mkError :: (GetRange a, Pretty a) => String -> a -> Result b
- debug :: (GetRange a, Pretty a) => Int -> (String, a) -> Result ()
- plain_error :: a -> String -> Range -> Result a
- warning :: a -> String -> Range -> Result a
- justWarn :: a -> String -> Result a
- hint :: a -> String -> Range -> Result a
- justHint :: a -> String -> Result a
- message :: a -> String -> Result a
- maybeToResult :: Range -> String -> Maybe a -> Result a
- resultToMonad :: Monad m => String -> Result a -> m a
- resultToMaybe :: Result a -> Maybe a
- adjustPos :: Range -> Result a -> Result a
- updDiagKind :: (DiagKind -> DiagKind) -> Diagnosis -> Diagnosis
- propagateErrors :: String -> Result a -> a
- showErr :: ParseError -> String
- prettyRange :: [Pos] -> Doc
- filterDiags :: Int -> [Diagnosis] -> [Diagnosis]
- showRelDiags :: Int -> [Diagnosis] -> String
- printDiags :: Int -> [Diagnosis] -> IO ()
Documentation
data DiagKind
severness of diagnostic messages
mkDiag :: (GetRange a, Pretty a) => DiagKind -> String -> a -> Diagnosis
construct a message for a printable item that carries a position
mkNiceDiag :: (GetRange a, Pretty a) => GlobalAnnos -> DiagKind -> String -> a -> Diagnosis
construct a message for a printable item that carries a position
isErrorDiag :: Diagnosis -> Bool
check whether a diagnosis is an error
addErrorDiag :: (GetRange a, Pretty a) => String -> a -> Result b -> Result b
add a further error message to explain a failure
checkUniqueness :: (Pretty a, GetRange a, Ord a) => [a] -> [Diagnosis]
A uniqueness check yields errors for duplicates in a given list.
data Result a
The result monad. A failing result should include an error message.
Result | |
|
appendDiags :: [Diagnosis] -> Result ()
joinResultWith :: (a -> b -> c) -> Result a -> Result b -> Result c
join two results with a combining function
joinResult :: Result a -> Result b -> Result b
join two results
fatal_error :: String -> Range -> Result a
a failing result with a proper position
mkError :: (GetRange a, Pretty a) => String -> a -> Result b
a failing result constructing a message from a type
plain_error :: a -> String -> Range -> Result a
add an error message but don't fail
resultToMonad :: Monad m => String -> Result a -> m a
Propagate errors using the error function
resultToMaybe :: Result a -> Maybe a
check whether no errors are present, coerce into Maybe
updDiagKind :: (DiagKind -> DiagKind) -> Diagnosis -> Diagnosis
change the diag kind of a diagnosis
propagateErrors :: String -> Result a -> a
Propagate errors using the error function
showErr :: ParseError -> String
showing (Parsec) parse errors using our own showPos
function
prettyRange :: [Pos] -> Doc
filterDiags :: Int -> [Diagnosis] -> [Diagnosis]
showRelDiags :: Int -> [Diagnosis] -> String
printDiags :: Int -> [Diagnosis] -> IO ()