ghc-8.0.0.20160111: The GHC API

Safe HaskellNone
LanguageHaskell2010

TmOracle

Synopsis

Documentation

data PmExpr

Lifted expressions for pattern match checking.

Instances

data PmLit

Literals (simple and overloaded ones) for pattern match checking.

Constructors

PmSLit HsLit 
PmOLit Bool (HsOverLit Id) 

Instances

type SimpleEq = (Id, PmExpr)

Term equalities

type PmVarEnv = Map Id PmExpr

The type of substitutions.

falsePmExpr :: PmExpr

Expression False

canDiverge :: Id -> TmState -> Bool

Check whether a constraint (x ~ BOT) can succeed, given the resulting state of the term oracle.

eqPmLit :: PmLit -> PmLit -> Bool

Equality between literals for pattern match checking.

filterComplex :: [ComplexEq] -> [PmNegLitCt]

isNotPmExprOther :: PmExpr -> Bool

Check if an expression is lifted or not

runPmPprM :: PmPprM a -> [PmNegLitCt] -> (a, [(SDoc, [PmLit])])

tmOracle :: TmState -> [ComplexEq] -> Maybe TmState

External interface to the term oracle.

type TmState = ([ComplexEq], TmOracleEnv)

The state of the term oracle (includes complex constraints that cannot progress unless we get more information).

initialTmState :: TmState

Initial state of the oracle.

exprDeepLookup :: PmVarEnv -> PmExpr -> PmExpr

Apply an (un-flattened) substitution to an expression.

pmLitType :: PmLit -> Type

Type of a PmLit

flattenPmVarEnv :: PmVarEnv -> PmVarEnv

Flatten the DAG (Could be improved in terms of performance.).