ddc-base- Disciplined Disciple Compiler common utilities.

Safe HaskellSafe-Inferred



A simple exception monad.



data CheckM s err a Source

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


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


Monad (CheckM s err) 
Functor (CheckM s err) 
Applicative (CheckM s err) 

throw :: err -> CheckM s err aSource

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 aSource

Run a checker computation, ignoreing the final state.

get :: CheckM s err sSource

Get the state from the monad.

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

Put a new state into the monad.