git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix a small bug in the type pretty-printer
commita6de68c6ce496aa7786a9ade4d40657b9a4400bd authorPhil Freeman <paf31@cantab.net> dateWed 21 Sep 2016, 19:33 (10 years ago) parent8197c06
1 file changed+4−4
src/Language/PureScript/Pretty/Types.hs+4−4
src/Language/PureScript/Pretty/Types.hs+4−4
@@ -45,11 +45,11 @@ typeLiterals = mkPattern match
4545 match _ = Nothing
4646
4747constraintsAsBox :: [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