 | hets -- a heterogenous Specification (CASL) tool set | Contents | Index |
|
Common.Result | Portability | portable | Stability | provisional | Maintainer | hets@tzi.de |
|
|
|
|
|
Description |
This module provides a Result type and some monadic functions to
use this type for accumulation of errors and warnings occuring
during the analyse phases.
|
|
Synopsis |
|
|
|
Documentation |
|
maxdiags :: Int |
maximum number of messages that are output |
|
data DiagKind |
severness of diagnostic messages | Constructors | FatalError | | Error | | Warning | | Hint | | Debug | |
| Instances | |
|
|
data Diagnosis |
a diagnostic message with a position | Constructors | | Instances | |
|
|
mkDiag :: (PosItem a, PrettyPrint a) => DiagKind -> String -> a -> Diagnosis |
construct a message for a printable item that carries a position |
|
hasErrors :: [Diagnosis] -> Bool |
Check whether a diagnosis list contains errors |
|
checkUniqueness :: (PrettyPrint a, PosItem a, Ord a) => [a] -> [Diagnosis] |
errors for duplicates in argument, selector or constructor lists. |
|
data Result a |
The Result monad.
A failing Result should include a FatalError message.
Otherwise diagnostics should be non-fatal. | Constructors | | Instances | |
|
|
class Mergeable a where |
merge together repeated or extended items | | Methods | | | Instances | |
|
|
ioBind :: IO (Result a) -> (a -> IO (Result b)) -> IO (Result b) |
|
newtype IOResult a |
|
|
ioresToIO :: IOResult a -> IO (Result a) |
|
ioToIORes :: IO a -> IOResult a |
|
resToIORes :: Result a -> IOResult a |
|
fatal_error :: String -> Pos -> Result a |
a failing result with a proper position |
|
pfatal_error :: Doc -> Pos -> Result a |
a failing result, using pretty printed Doc |
|
plain_error :: a -> String -> Pos -> Result a |
add an error message but continue (within do) |
|
pplain_error :: a -> Doc -> Pos -> Result a |
an error message, using pretty printed Doc |
|
warning :: a -> String -> Pos -> Result a |
add a warning |
|
maybeToResult :: Pos -> String -> Maybe a -> Result a |
add a fatal error message to a failure (Nothing) |
|
adjustPos :: Pos -> Result a -> Result a |
|
propagateErrors :: Result a -> a |
Propagate errors using the error function |
|
debug :: PrettyPrint a => Int -> (String, a) -> Result () |
|
showPretty :: PrettyPrint a => a -> ShowS |
a more pretty alternative for shows |
|
Produced by Haddock version 0.6 |