curry-base-1.1.1: Functions for manipulating Curry programs

Copyright2014 - 2016 Björn Peemöller
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Curry.Base.Monad

Description

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

Documentation

type CYIO a = CYT IO a Source #

Curry compiler monad based on the IO monad

type CYM a = CYT Identity a Source #

Pure Curry compiler monad

type CYT m a = WriterT [Message] (ExceptT [Message] m) a Source #

Curry compiler monad transformer

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.

ok :: Monad m => a -> CYT m a Source #

Lift a value into the `CYT m` monad, same as return.

runCYIO :: CYIO a -> IO (Either [Message] (a, [Message])) Source #

Run an IO-based Curry compiler action in the IO monad, 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

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

runCYIOIgnWarn :: CYIO a -> IO (Either [Message] a) Source #

Run an IO-based Curry compiler action in the IO monad, yielding either a list of errors or a result in case of success.

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.

liftCYM :: Monad m => CYM a -> CYT m a Source #

Lift a pure action into an action based on another monad.

silent :: Monad m => CYT m a -> CYT m a Source #

Execute a monadic action, but ignore any warnings it issues