1{-# OPTIONS_GHC -Wall #-}
2module AST.Expression.Source
3 ( RawExpr, RawExpr', RawDef, RawDef'(..)
4 , ValidExpr, ValidExpr', ValidDef(..)
6 , var, tuple, getPattern, collectLambdas
11import qualified AST.Literal as Literal
12import qualified AST.Pattern as Ptrn
13import qualified AST.Type as Type
14import qualified AST.Variable as Var
15import qualified Reporting.Annotation as A
16import qualified Reporting.Region as R
28 = Literal Literal.Literal
31 | Binop [(Expr def, A.Located String)] (Expr def)
32 | Lambda Ptrn.Raw (Expr def)
33 | App (Expr def) (Expr def)
34 | If [(Expr def, Expr def)] (Expr def)
35 | Let [def] (Expr def)
36 | Case (Expr def) [(Ptrn.Raw, Expr def)]
37 | Ctor String [Expr def]
38 | Access (Expr def) String
39 | Update (Expr def) [(A.Located String, Expr def)]
40 | Record [(A.Located String, Expr def)]
41 | GLShader String String Literal.GLShaderTipe
44type RawExpr = Expr RawDef
46type RawExpr' = Expr' RawDef
48type ValidExpr = Expr ValidDef
50type ValidExpr' = Expr' ValidDef
62 = Definition Ptrn.Raw RawExpr
63 | Annotation String Type.Raw
67 Def R.Region Ptrn.Raw ValidExpr (Maybe Type.Raw)
74var :: String -> Expr' def
79tuple :: [Expr def] -> Expr' def
81 Ctor ("_Tuple" ++ show (length expressions)) expressions
84getPattern :: ValidDef -> Ptrn.Raw
85getPattern (Def _ pattern _ _) =
89collectLambdas :: Expr def -> ([Ptrn.Raw], Expr def)
90collectLambdas lexpr@(A.A _ expr) =
92 Lambda pattern body ->
94 (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