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

Safe HaskellSafe-Inferred

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

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.