contract-0.1.0.0
Copyright(c) Xie Ruifeng 2020
LicenseAGPL-3
Maintainerkrantz.xrf@outlook.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Language.Contract.Check

Description

 
Synopsis

Documentation

type MonadTypeCheck m = (MonadReader ([Type], [Term]) m, MonadFail m, MonadIO m) Source #

Type checker monad.

runTypeCheck :: MaybeT (ReaderT ([Type], [Term]) IO) a -> IO (Maybe a) Source #

Run the type checker monad, get a Maybe result.

assert :: MonadFail m => Bool -> m () Source #

Assertion, fail with MonadFail. guard from Prelude uses Alternative, so not suitable here.

prove :: MonadTypeCheck m => Term -> m () Source #

Prove a term in the type checker monad.

typeOf :: MonadTypeCheck m => Term -> m Type Source #

The type of a term, within a specific context.

eval1 :: [Term] -> Term -> Term Source #

One-step evaluation of a term.

evalWith :: [Term] -> Term -> Term Source #

Full evaluation of a term.

eval :: Term -> Term Source #

Full evaluation of a term.