Copyright | (c) 2011 - 2016 Björn Peemöller |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Base.Messages
Description
This module defines several operations to construct and emit compiler messages to the user.
Synopsis
- class Monad m => MonadIO (m :: * -> *) where
- status :: MonadIO m => Options -> String -> m ()
- putMsg :: MonadIO m => String -> m ()
- putErrLn :: MonadIO m => String -> m ()
- putErrsLn :: MonadIO m => [String] -> m ()
- abortWith :: [String] -> IO a
- abortWithMessage :: Message -> IO a
- abortWithMessages :: [Message] -> IO a
- warnOrAbort :: WarnOpts -> [Message] -> IO ()
- internalError :: String -> a
- data Message
- message :: Doc -> Message
- posMessage :: HasPosition p => p -> Doc -> Message
- spanInfoMessage :: HasSpanInfo s => s -> Doc -> Message
Output of user information
class Monad m => MonadIO (m :: * -> *) where #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Minimal complete definition
Instances
status :: MonadIO m => Options -> String -> m () Source #
Print a status message, depending on the current verbosity
program abortion
abortWithMessage :: Message -> IO a Source #
Print a single error message on stderr
and abort the program
abortWithMessages :: [Message] -> IO a Source #
Print a list of error messages on stderr
and abort the program
warnOrAbort :: WarnOpts -> [Message] -> IO () Source #
Print a list of warning messages on stderr
and abort the program
|if the -Werror option is set
internalError :: String -> a Source #
Raise an internal error
creating messages
Compiler message
Instances
Eq Message Source # | |
Ord Message Source # | |
Show Message Source # | |
Pretty Message Source # | |
HasPosition Message Source # | |
Defined in Curry.Base.Message | |
HasSpanInfo Message Source # | |
Defined in Curry.Base.Message Methods getSpanInfo :: Message -> SpanInfo Source # setSpanInfo :: SpanInfo -> Message -> Message Source # updateEndPos :: Message -> Message Source # getLayoutInfo :: Message -> LayoutInfo Source # |
posMessage :: HasPosition p => p -> Doc -> Message Source #
Construct a message from a position.
spanInfoMessage :: HasSpanInfo s => s -> Doc -> Message Source #
Construct a message from an entity with a SpanInfo
and a text