ddc-core-0.2.1.2: Disciple Core language and type checker.

Safe HaskellSafe-Inferred

DDC.Core.Predicates

Contents

Description

Simple predicates on core expressions.

Synopsis

Atoms

isXVar :: Exp a n -> BoolSource

Check whether an expression is a variable.

isXCon :: Exp a n -> BoolSource

Check whether an expression is a constructor.

isAtomW :: Witness n -> BoolSource

Check whether a witness is a WVar or WCon.

isAtomX :: Exp a n -> BoolSource

Check whether an expression is a XVar or an XCon, or some type or witness atom.

Lambdas

isXLAM :: Exp a n -> BoolSource

Check whether an expression is a spec abstraction (level-1).

isXLam :: Exp a n -> BoolSource

Check whether an expression is a value or witness abstraction (level-0).

isLambdaX :: Exp a n -> BoolSource

Check whether an expression is a spec, value, or witness abstraction.

Applications

isXApp :: Exp a n -> BoolSource

Check whether an expression is an XApp.

Patterns

isPDefault :: Pat n -> BoolSource

Check whether an alternative is a PDefault.