stil4m/elm-syntax/4.0.3

NOTE: this package is not compatible with Elm 0.19.1

Elm.Syntax.Expression

Expression Syntax

Expression

= UnitExpr
| Application (List (Ranged Expression))
| OperatorApplication
String
InfixDirection
(Ranged Expression)
(Ranged Expression)
| FunctionOrValue String
| IfBlock
(Ranged Expression)
(Ranged Expression)
(Ranged Expression)
| PrefixOperator String
| Operator String
| Integer Int
| Floatable Float
| Negation (Ranged Expression)
| Literal String
| CharLiteral Char
| TupledExpression (List (Ranged Expression))
| ParenthesizedExpression (Ranged Expression)
| LetExpression LetBlock
| CaseExpression CaseBlock
| LambdaExpression Lambda
| RecordExpr (List RecordSetter)
| ListExpr (List (Ranged Expression))
| QualifiedExpr ModuleName String
| RecordAccess (Ranged Expression) String
| RecordAccessFunction String
| RecordUpdateExpression RecordUpdate
| GLSLExpression String

Wrapper type for an expresion on a certain range

type alias Lambda =
{ args : List (Ranged Pattern)
, expression : Ranged Expression
}

Expression for a lambda

Lets

type alias LetBlock =
{ declarations : List (Ranged LetDeclaration)
, expression : Ranged Expression
}

Expression for a let block

= LetFunction Function
| LetDestructuring (Ranged Pattern) (Ranged Expression)

Union type for all possible declations in a let block

Records

type alias RecordUpdate =
{ name : String
, updates : List RecordSetter
}

Expression for updating a record

type alias RecordSetter =
( String, Ranged Expression )

Expression for setting a record field

Cases

type alias CaseBlock =
{ expression : Ranged Expression
, cases : Cases
}

Expression for a case block

type alias Cases =
List Case

Type alias for a list of cases

type alias Case =
( Ranged Pattern, Ranged Expression )

A case in a case block

Functions

type alias Function =
{ documentation : Maybe Documentation
, signature : Maybe (Ranged FunctionSignature)
, declaration : FunctionDeclaration
}

Type alias for a full function

type alias FunctionDeclaration =
{ operatorDefinition : Bool
, name : VariablePointer
, arguments : List (Ranged Pattern)
, expression : Ranged Expression
}

Type alias for declaring a function

type alias FunctionSignature =
{ operatorDefinition : Bool
, name : VariablePointer
, typeAnnotation : Ranged TypeAnnotation
}

Type alias for a function signature

functionRange : Function -> Range

Get the full range of a function

Utiltity functions

isLambda : Expression -> Bool

Check whether an expression is a lambda-expression

isLet : Expression -> Bool

Check whether an expression is a let-expression

isIfElse : Expression -> Bool

Check whether an expression is an if-else-expression

isCase : Expression -> Bool

Check whether an expression is a case-expression

isOperatorApplication : Expression -> Bool

Check whether an expression is an operator appliation expression