language-boogie-0.2: Interpreter and language infrastructure for Boogie.

Safe HaskellSafe-Inferred

Language.Boogie.ErrorAccum

Description

This monad transformer adds the ability to accumulate errors from several ErrorT computations and report them all at once.

Synopsis

Documentation

newtype ErrorAccumT e m a Source

Error accumulator: used in combination with ErrorT to store intermediate computation results, when errors should be accumulated rather than reported immediately

Constructors

ErrorAccumT 

Fields

runErrorAccumT :: m ([e], a)
 

Instances

accum :: (ErrorList e, Monad m) => ErrorT [e] m a -> a -> ErrorAccumT e m aSource

Transform an error computation and default value into an error accumlator

report :: (ErrorList e, Monad m) => ErrorAccumT e m a -> ErrorT [e] m aSource

Transform an error accumlator back into a regular error computation

mapAccum :: (ErrorList e, Monad m) => (a -> ErrorT [e] m b) -> b -> [a] -> ErrorT [e] m [b]Source

mapAccum f def xs : Apply f to all xs, accumulating errors and reporting them at the end

mapAccumA_ :: (ErrorList e, Monad m) => (a -> ErrorT [e] m ()) -> [a] -> ErrorAccumT e m ()Source

mapAccumA_ f xs : Apply f to all xs throwing away the result, accumulating errors

mapAccum_ :: (ErrorList e, Monad m) => (a -> ErrorT [e] m ()) -> [a] -> ErrorT [e] m ()Source

Same as mapAccumA_, but reporting errors at the end

zipWithAccum_ :: (ErrorList e, Monad m) => (a -> b -> ErrorT [e] m ()) -> [a] -> [b] -> ErrorT [e] m ()Source

zipWithAccum_ f xs ys : Apply type checking f to all xs and ys throwing away the result, accumulating errors and reporting them at the end