Copyright | 2014 - 2016 Björn Peemöller |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
The monads defined in this module provide a common way to stop execution when some errors occur. They are used to integrate different compiler passes smoothly.
Synopsis
- type CYIO a = CYT IO a
- type CYM a = CYT Identity a
- type CYT m a = WriterT [Message] (ExceptT [Message] m) a
- failMessages :: Monad m => [Message] -> CYT m a
- failMessageAt :: Monad m => Position -> String -> CYT m a
- warnMessages :: Monad m => [Message] -> CYT m ()
- warnMessageAt :: Monad m => Position -> String -> CYT m ()
- ok :: Monad m => a -> CYT m a
- runCYIO :: CYIO a -> IO (Either [Message] (a, [Message]))
- runCYM :: CYM a -> Either [Message] (a, [Message])
- runCYIOIgnWarn :: CYIO a -> IO (Either [Message] a)
- runCYMIgnWarn :: CYM a -> Either [Message] a
- liftCYM :: Monad m => CYM a -> CYT m a
- silent :: Monad m => CYT m a -> CYT m a
Documentation
failMessages :: Monad m => [Message] -> CYT m a Source #
Failing action with a list of messages describing the cause(s) of failure.
failMessageAt :: Monad m => Position -> String -> CYT m a Source #
Failing action with a source code position and a String
indicating
the cause of failure.
warnMessages :: Monad m => [Message] -> CYT m () Source #
Warning with a list of messages describing the cause(s) of the warnings.
warnMessageAt :: Monad m => Position -> String -> CYT m () Source #
Warning with a source code position and a String
indicating
the cause of the warning.
runCYM :: CYM a -> Either [Message] (a, [Message]) Source #
Run an pure Curry compiler action, yielding either a list of errors or a result in case of success consisting of the actual result and a (possibly empty) list of warnings
runCYMIgnWarn :: CYM a -> Either [Message] a Source #
Run an pure Curry compiler action, yielding either a list of errors or a result in case of success.