1{-# OPTIONS_GHC -Wall #-}
3module AST.Expression.Valid where
6import Text.PrettyPrint as P
7import qualified AST.Expression.General as General
8import AST.Type (RawType)
9import qualified AST.Variable as Var
10import qualified AST.Annotation as Annotation
11import qualified AST.Pattern as Pattern
14{-| "Normal" expressions. When the compiler checks that type annotations and
15ports are all paired with definitions in the appropriate order, it collapses
16them into a Def that is easier to work with in later phases of compilation.
18type Expr = General.Expr Annotation.Region Def Var.Raw
19type Expr' = General.Expr' Annotation.Region Def Var.Raw
21data Def = Definition Pattern.RawPattern Expr (Maybe RawType)
24instance Pretty Def where
25 pretty (Definition pattern expr maybeTipe) =
26 P.vcat [ annotation, definition ]
28 definition = pretty pattern <+> P.equals <+> pretty expr
29 annotation = case maybeTipe of
31 Just tipe -> pretty pattern <+> P.colon <+> pretty tipe
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