on master help sign in
Fix missing `{` when pretty printing empty record types
0eea430Evan Czaplicki
src/AST/Type.hs+4
@@ -62,6 +62,9 @@ instance (Var.ToString var, Pretty var) => Pretty (Type var) where
62
62
63 Record _ _ ->
63 Record _ _ ->
64 case flattenRecord tipe of
64 case flattenRecord tipe of
65+ ([], Nothing) ->
66+ P.text "{}"
67+
65 (fields, Nothing) ->
68 (fields, Nothing) ->
66 P.sep
69 P.sep
67 [ P.cat (zipWith (<+>) (P.lbrace : repeat P.comma) (map prettyField fields))
70 [ P.cat (zipWith (<+>) (P.lbrace : repeat P.comma) (map prettyField fields))
@@ -86,6 +89,7 @@ instance (Var.ToString var, Pretty var) => Pretty (Type var) where
86 then t'
89 then t'
87 else pretty name
90 else pretty name
88
91
92+
89collectLambdas :: Type var -> [Type var]
93collectLambdas :: Type var -> [Type var]
90collectLambdas tipe =
94collectLambdas tipe =
91 case tipe of
95 case tipe of