1{-# OPTIONS_GHC -Wall #-}
2module AST.Expression.Source
3 ( RawExpr, RawExpr', RawDef, RawDef'(..)
4 , ValidExpr, ValidExpr', ValidDef(..)
11import Data.Text (Text)
13import qualified AST.Literal as Literal
14import qualified AST.Pattern as Ptrn
15import qualified AST.Type as Type
16import qualified Reporting.Annotation as A
17import qualified Reporting.Region as R
29 = Literal Literal.Literal
30 | Var (Maybe Text) Text
33 | Binop [(Expr def, A.Located Text)] (Expr def)
34 | Lambda Ptrn.Raw (Expr def)
35 | App (Expr def) (Expr def)
36 | If [(Expr def, Expr def)] (Expr def)
37 | Let [def] (Expr def)
38 | Case (Expr def) [(Ptrn.Raw, Expr def)]
40 | Access (Expr def) Text
41 | Update (A.Located Text) [(A.Located Text, Expr def)]
42 | Record [(A.Located Text, Expr def)]
44 | Tuple (Expr def) (Expr def) [Expr def]
45 | GLShader Text Text Literal.Shader
48type RawExpr = Expr RawDef
50type RawExpr' = Expr' RawDef
52type ValidExpr = Expr ValidDef
54type ValidExpr' = Expr' ValidDef
66 = Annotation Text Type.Raw
67 | Definition Text [Ptrn.Raw] RawExpr
68 | Destructure Ptrn.Raw RawExpr
72 = VDefinition R.Region Text [Ptrn.Raw] ValidExpr (Maybe Type.Raw)
73 | VDestructure R.Region Ptrn.Raw ValidExpr
82 Literal (Literal.IntNum 0)
85collectLambdas :: Expr def -> ([Ptrn.Raw], Expr def)
86collectLambdas lexpr@(A.A _ expr) =
88 Lambda pattern body ->
90 (ps, body') = collectLambdas body
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list