Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Abstract syntax for the Disciple core language.
Documentation
module DDC.Type.Exp
Expressions
Well-typed expressions have types of kind Data
.
XVar !a !(Bound n) | Value variable or primitive operation. |
XCon !a !(DaCon n (Type n)) | Data constructor or literal. |
XLAM !a !(Bind n) !(Exp a n) | Type abstraction (level-1). |
XLam !a !(Bind n) !(Exp a n) | Value and Witness abstraction (level-0). |
XApp !a !(Exp a n) !(Exp a n) | Application. |
XLet !a !(Lets a n) !(Exp a n) | Possibly recursive bindings. |
XCase !a !(Exp a n) ![Alt a n] | Case branching. |
XCast !a !(Cast a n) !(Exp a n) | Type cast. |
XType !a !(Type n) | Type can appear as the argument of an application. |
XWitness !a !(Witness a n) | Witness can appear as the argument of an application. |
Reannotate Exp Source # | |
Complies Exp Source # | |
SubstituteWX Exp Source # | |
SubstituteXX Exp Source # | |
SpreadX (Exp a) Source # | |
SupportX (Exp a) Source # | |
SubstituteTX (Exp a) Source # | |
MapBoundX (Exp a) n Source # | |
(Eq a, Eq n) => Eq (Exp a n) Source # | |
(Show a, Show n) => Show (Exp a n) Source # | |
(NFData a, NFData n) => NFData (Exp a n) Source # | |
data PrettyMode (Exp a n) Source # | |
Possibly recursive bindings.
Case alternatives.
Reannotate Alt Source # | |
Complies Alt Source # | |
SubstituteWX Alt Source # | |
SubstituteXX Alt Source # | |
SpreadX (Alt a) Source # | |
SupportX (Alt a) Source # | |
SubstituteTX (Alt a) Source # | |
MapBoundX (Alt a) n Source # | |
(Eq a, Eq n) => Eq (Alt a n) Source # | |
(Show a, Show n) => Show (Alt a n) Source # | |
(NFData a, NFData n) => NFData (Alt a n) Source # | |
data PrettyMode (Alt a n) Source # | |
Pattern matching.
Type casts.
CastWeakenEffect !(Effect n) | Weaken the effect of an expression. The given effect is added to the effect of the body. |
CastPurify !(Witness a n) | Purify the effect (action) of an expression. |
CastBox | Box up a computation, capturing its effects in the S computation type. |
CastRun | Run a computation, releasing its effects into the environment. |
Reannotate Cast Source # | |
SubstituteWX Cast Source # | |
SubstituteXX Cast Source # | |
SpreadX (Cast a) Source # | |
SupportX (Cast a) Source # | |
SubstituteTX (Cast a) Source # | |
MapBoundX (Cast a) n Source # | |
(Eq a, Eq n) => Eq (Cast a n) Source # | |
(Show a, Show n) => Show (Cast a n) Source # | |
(NFData a, NFData n) => NFData (Cast a n) Source # | |
Witnesses
When a witness exists in the program it guarantees that a certain property of the program is true.
WVar a !(Bound n) | Witness variable. |
WCon a !(WiCon n) | Witness constructor. |
WApp a !(Witness a n) !(Witness a n) | Witness application. |
WType a !(Type n) | Type can appear as the argument of an application. |
Reannotate Witness Source # | |
SubstituteWX Witness Source # | |
SpreadX (Witness a) Source # | |
SupportX (Witness a) Source # | |
SubstituteTX (Witness a) Source # | |
MapBoundX (Witness a) n Source # | |
(Eq a, Eq n) => Eq (Witness a n) Source # | |
(Show a, Show n) => Show (Witness a n) Source # | |
(NFData a, NFData n) => NFData (Witness a n) Source # | |
Data Constructors
Data constructors.
DaConUnit | Baked in unit data constructor. |
DaConPrim | Primitive data constructor used for literals and baked-in constructors. The type of the constructor needs to be attached to handle the case where there are too many constructors in the data type to list, like for Int literals. In this case we determine what data type it belongs to from the attached type of the data constructor. |
DaConBound | Data constructor that has a data type declaration. |
|
Witness Constructors
Witness constructors.
WiConBound !(Bound n) !(Type n) | Witness constructors defined in the environment. In the interpreter we use this to hold runtime capabilities. The attached type must be closed. |