@@ -15,18 +15,25 @@ import qualified AST.Pattern as Pattern
1515annotations and definitions, which is how they appear in source code and how
1616they are parsed.
1717-}
18−type Expr = General.Expr Annotation.Region Def Var.Raw
19−type Expr' = General.Expr' Annotation.Region Def Var.Raw
18+type Expr =
19+ General.Expr Annotation.Region Def Var.Raw
20+
21+
22+type Expr' =
23+ General.Expr' Annotation.Region Def Var.Raw
24+
2025
2126data Def
2227 = Definition Pattern.RawPattern Expr
2328 | TypeAnnotation String RawType
2429 deriving (Show)
2530
31+
2632instance Pretty Def where
2733 pretty def =
28− case def of
29− TypeAnnotation name tipe ->
30− variable name <+> P.colon <+> pretty tipe
31− Definition pattern expr ->
32− pretty pattern <+> P.equals <+> pretty expr
34+ case def of
35+ TypeAnnotation name tipe ->
36+ variable name <+> P.colon <+> pretty tipe
37+
38+ Definition pattern expr ->
39+ pretty pattern <+> P.equals <+> pretty expr