git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2322 from purescript/phil/constraint-layout
354e793Phil Freeman
src/Language/PureScript/Pretty/Types.hs+4−4
@@ -45,11 +45,11 @@ typeLiterals = mkPattern match
45 match _ = Nothing
45 match _ = Nothing
46
46
47constraintsAsBox :: [Constraint] -> Box -> Box
47constraintsAsBox :: [Constraint] -> Box -> Box
48−constraintsAsBox [(Constraint pn tys _)] ty = text "(" <> constraintAsBox pn tys `before` (text ") => " <> ty)
48+constraintsAsBox [con] ty = text "(" <> constraintAsBox con `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)
49+constraintsAsBox xs ty = vcat left (zipWith (\i con -> text (if i == 0 then "( " else ", ") <> constraintAsBox con) [0 :: Int ..] xs) `before` (text ") => " <> ty)
50
50
51−constraintAsBox :: Qualified (ProperName a) -> [Type] -> Box
51+constraintAsBox :: Constraint -> Box
52−constraintAsBox pn tys = hsep 1 left (text (runProperName (disqualify pn)) : map typeAtomAsBox tys)
52+constraintAsBox (Constraint pn tys _) = typeAsBox (foldl TypeApp (TypeConstructor (fmap coerceProperName pn)) tys)
53
53
54-- |
54-- |
55-- Generate a pretty-printed string representing a Row
55-- Generate a pretty-printed string representing a Row