ddc-base-0.4.2.1: Disciplined Disciple Compiler common utilities.

Safe HaskellSafe
LanguageHaskell98

DDC.Control.Monad.Check

Description

A simple exception monad.

Synopsis

Documentation

data CheckM s err a Source

Checker monad maintains some state and manages errors during type checking.

Constructors

CheckM (s -> (s, Either err a)) 

Instances

throw :: err -> CheckM s err a Source

Throw a type error in the monad.

runCheck :: s -> CheckM s err a -> (s, Either err a) Source

Run a checker computation, returning the result and new state.

evalCheck :: s -> CheckM s err a -> Either err a Source

Run a checker computation, ignoreing the final state.

get :: CheckM s err s Source

Get the state from the monad.

put :: s -> CheckM s err () Source

Put a new state into the monad.