on master help sign in
Fix missing `{` when pretty printing empty record types
commit0eea43022818ce67356b3bea64c9f730024e3061 authorEvan Czaplicki <info@elm-lang.org> dateFri 28 Nov 2014, 20:24 (12 years ago) parent317f80e
1 file changed+4
src/AST/Type.hs+4
src/AST/Type.hs+4
@@ -62,6 +62,9 @@ instance (Var.ToString var, Pretty var) => Pretty (Type var) where
6262
6363 Record _ _ ->
6464 case flattenRecord tipe of
65+ ([], Nothing) ->
66+ P.text "{}"
67+
6568 (fields, Nothing) ->
6669 P.sep
6770 [ 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
8689 then t'
8790 else pretty name
8891
92+
8993collectLambdas :: Type var -> [Type var]
9094collectLambdas tipe =
9195 case tipe of