ddc-core-0.4.2.1: Disciplined Disciple Compiler core language and type checker.

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Exp.Annot.Predicates

Contents

Description

Simple predicates on core expressions.

Synopsis

Documentation

Atoms

isXVar :: Exp a n -> Bool Source

Check whether an expression is a variable.

isXCon :: Exp a n -> Bool Source

Check whether an expression is a constructor.

isAtomX :: Exp a n -> Bool Source

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

isAtomW :: Witness a n -> Bool Source

Check whether a witness is a WVar or WCon.

Lambdas

isXLAM :: Exp a n -> Bool Source

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

isXLam :: Exp a n -> Bool Source

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

isLambdaX :: Exp a n -> Bool Source

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

Applications

isXApp :: Exp a n -> Bool Source

Check whether an expression is an XApp.

Cast

isXCast :: Exp a n -> Bool Source

Check whether this is a cast expression.

isXCastBox :: Exp a n -> Bool Source

Check whether this is a box cast.

isXCastRun :: Exp a n -> Bool Source

Check whether this is a run cast.

Let bindings

isXLet :: Exp a n -> Bool Source

Check whether an expression is a XLet.

Patterns

isPDefault :: Pat n -> Bool Source

Check whether an alternative is a PDefault.

Types and Witnesses

isXType :: Exp a n -> Bool Source

Check whether an expression is an XType.

isXWitness :: Exp a n -> Bool Source

Check whether an expression is an XWitness.