Safe Haskell | None |
---|---|
Language | Haskell2010 |
The core functional representation
- data Expr a
- = Literal a (Literal (Expr a))
- | Constructor a (ProperName TypeName) (ProperName ConstructorName) [Ident]
- | Accessor a PSString (Expr a)
- | ObjectUpdate a (Expr a) [(PSString, Expr a)]
- | Abs a Ident (Expr a)
- | App a (Expr a) (Expr a)
- | Var a (Qualified Ident)
- | Case a [Expr a] [CaseAlternative a]
- | Let a [Bind a] (Expr a)
- data Bind a
- type Guard a = Expr a
- data CaseAlternative a = CaseAlternative {
- caseAlternativeBinders :: [Binder a]
- caseAlternativeResult :: Either [(Guard a, Expr a)] (Expr a)
- extractAnn :: Expr a -> a
- modifyAnn :: (a -> a) -> Expr a -> Expr a
Documentation
Data type for expressions and terms
Literal a (Literal (Expr a)) | A literal value |
Constructor a (ProperName TypeName) (ProperName ConstructorName) [Ident] | A data constructor (type name, constructor name, field names) |
Accessor a PSString (Expr a) | A record property accessor |
ObjectUpdate a (Expr a) [(PSString, Expr a)] | Partial record update |
Abs a Ident (Expr a) | Function introduction |
App a (Expr a) (Expr a) | Function application |
Var a (Qualified Ident) | Variable |
Case a [Expr a] [CaseAlternative a] | A case expression |
Let a [Bind a] (Expr a) | A let binding |
A let or module binding.
type Guard a = Expr a Source #
A guard is just a boolean-valued expression that appears alongside a set of binders
data CaseAlternative a Source #
An alternative in a case statement
CaseAlternative | |
|
Functor CaseAlternative Source # | |
Show a => Show (CaseAlternative a) Source # | |
extractAnn :: Expr a -> a Source #
Extract the annotation from a term