Skip to content

Commit

Permalink
Fix missing { when pretty printing empty record types
Browse files Browse the repository at this point in the history
  • Loading branch information
process-bot committed Nov 29, 2014
1 parent 317f80e commit 0eea430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AST/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ instance (Var.ToString var, Pretty var) => Pretty (Type var) where

Record _ _ ->
case flattenRecord tipe of
([], Nothing) ->
P.text "{}"

(fields, Nothing) ->
P.sep
[ P.cat (zipWith (<+>) (P.lbrace : repeat P.comma) (map prettyField fields))
Expand All @@ -86,6 +89,7 @@ instance (Var.ToString var, Pretty var) => Pretty (Type var) where
then t'
else pretty name


collectLambdas :: Type var -> [Type var]
collectLambdas tipe =
case tipe of
Expand Down

0 comments on commit 0eea430

Please sign in to comment.