Skip to content

Commit a6de68c

Browse files
committed
Fix a small bug in the type pretty-printer
1 parent 8197c06 commit a6de68c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Language/PureScript/Pretty/Types.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ typeLiterals = mkPattern match
4545
match _ = Nothing
4646

4747
constraintsAsBox :: [Constraint] -> Box -> Box
48-
constraintsAsBox [(Constraint pn tys _)] ty = text "(" <> constraintAsBox pn tys `before` (text ") => " <> ty)
49-
constraintsAsBox xs ty = vcat left (zipWith (\i (Constraint pn tys _) -> text (if i == 0 then "( " else ", ") <> constraintAsBox pn tys) [0 :: Int ..] xs) `before` (text ") => " <> ty)
48+
constraintsAsBox [con] ty = text "(" <> constraintAsBox con `before` (text ") => " <> ty)
49+
constraintsAsBox xs ty = vcat left (zipWith (\i con -> text (if i == 0 then "( " else ", ") <> constraintAsBox con) [0 :: Int ..] xs) `before` (text ") => " <> ty)
5050

51-
constraintAsBox :: Qualified (ProperName a) -> [Type] -> Box
52-
constraintAsBox pn tys = hsep 1 left (text (runProperName (disqualify pn)) : map typeAtomAsBox tys)
51+
constraintAsBox :: Constraint -> Box
52+
constraintAsBox (Constraint pn tys _) = typeAsBox (foldl TypeApp (TypeConstructor (fmap coerceProperName pn)) tys)
5353

5454
-- |
5555
-- Generate a pretty-printed string representing a Row

0 commit comments

Comments
 (0)