@@ -45,15 +45,17 @@ typeLiterals = mkPattern match
4545 match (TypeConstructor ctor) = Just $ text $ runProperName $ disqualify ctor
4646 match (TUnknown u) = Just $ text $ '_' : show u
4747 match (Skolem name s _) = Just $ text $ name ++ show s
48− match (ConstrainedType deps ty) = Just $ constraintsAsBox deps `before` (text ") => " <> typeAsBox ty)
48+ match (ConstrainedType deps ty) = Just $ constraintsAsBox deps ty
4949 match REmpty = Just $ text "()"
5050 match row@RCons{} = Just $ prettyPrintRowWith '(' ')' row
5151 match _ = Nothing
5252
53−constraintsAsBox :: [(Qualified ProperName, [Type])] -> Box
54−constraintsAsBox = vcat left . zipWith (\i (pn, tys) -> text (if i == 0 then "( " else ", ") <> constraintAsBox pn tys) [0 :: Int ..]
55− where
56− constraintAsBox pn tys = hsep 1 left (text (runProperName (disqualify pn)) : map typeAtomAsBox tys)
53+constraintsAsBox :: [(Qualified ProperName, [Type])] -> Type -> Box
54+constraintsAsBox [(pn, tys)] ty = text "(" <> constraintAsBox pn tys <> text ") => " <> typeAsBox ty
55+constraintsAsBox xs ty = vcat left (zipWith (\i (pn, tys) -> text (if i == 0 then "( " else ", ") <> constraintAsBox pn tys) [0 :: Int ..] xs) `before` (text ") => " <> typeAsBox ty)
56+
57+constraintAsBox :: Qualified ProperName -> [Type] -> Box
58+constraintAsBox pn tys = hsep 1 left (text (runProperName (disqualify pn)) : map typeAtomAsBox tys)
5759
5860-- |
5961-- Generate a pretty-printed string representing a Row