@@ -54,15 +54,15 @@ prettyPrintValue d (IfThenElse cond th el) =
54 // moveRight 2 (vcat left [ text "then " <> prettyPrintValueAtom (d - 1) th
54 // moveRight 2 (vcat left [ text "then " <> prettyPrintValueAtom (d - 1) th
55 , text "else " <> prettyPrintValueAtom (d - 1) el
55 , text "else " <> prettyPrintValueAtom (d - 1) el
57−prettyPrintValue d (Accessor prop val) = prettyPrintValueAtom (d - 1) val <> textT ("." Monoid.<> prettyPrintObjectKey prop)
57+prettyPrintValue d (Accessor prop val) = prettyPrintValueAtom (d - 1) val `before` textT ("." Monoid.<> prettyPrintObjectKey prop)
58−prettyPrintValue d (ObjectUpdate o ps) = prettyPrintValueAtom (d - 1) o <> text " " <> list '{' '}' (\(key, val) -> textT (key Monoid.<> " = ") <> prettyPrintValue (d - 1) val) ps
58+prettyPrintValue d (ObjectUpdate o ps) = prettyPrintValueAtom (d - 1) o `beforeWithSpace` list '{' '}' (\(key, val) -> textT (key Monoid.<> " = ") <> prettyPrintValue (d - 1) val) ps
59prettyPrintValue d (App val arg) = prettyPrintValueAtom (d - 1) val `beforeWithSpace` prettyPrintValueAtom (d - 1) arg
59prettyPrintValue d (App val arg) = prettyPrintValueAtom (d - 1) val `beforeWithSpace` prettyPrintValueAtom (d - 1) arg
60prettyPrintValue d (Abs (Left arg) val) = text ('\\' : T.unpack (showIdent arg) ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
60prettyPrintValue d (Abs (Left arg) val) = text ('\\' : T.unpack (showIdent arg) ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
61prettyPrintValue d (Abs (Right arg) val) = text ('\\' : T.unpack (prettyPrintBinder arg) ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
61prettyPrintValue d (Abs (Right arg) val) = text ('\\' : T.unpack (prettyPrintBinder arg) ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
62prettyPrintValue d (TypeClassDictionaryConstructorApp className ps) =
62prettyPrintValue d (TypeClassDictionaryConstructorApp className ps) =
63 text (T.unpack (runProperName (disqualify className)) ++ " ") <> prettyPrintValueAtom (d - 1) ps
63 text (T.unpack (runProperName (disqualify className)) ++ " ") <> prettyPrintValueAtom (d - 1) ps
64prettyPrintValue d (Case values binders) =
64prettyPrintValue d (Case values binders) =
65− (text "case " <> foldl1 beforeWithSpace (map (prettyPrintValueAtom (d - 1)) values) <> text " of") //
65+ (text "case " <> foldr beforeWithSpace (text "of") (map (prettyPrintValueAtom (d - 1)) values)) //
66 moveRight 2 (vcat left (map (prettyPrintCaseAlternative (d - 1)) binders))
66 moveRight 2 (vcat left (map (prettyPrintCaseAlternative (d - 1)) binders))
67prettyPrintValue d (Let ds val) =
67prettyPrintValue d (Let ds val) =
68 text "let" //
68 text "let" //
@@ -96,7 +96,7 @@ prettyPrintValueAtom d (BinaryNoParens op lhs rhs) =
96 prettyPrintValue (d - 1) lhs `beforeWithSpace` printOp op `beforeWithSpace` prettyPrintValue (d - 1) rhs
96 prettyPrintValue (d - 1) lhs `beforeWithSpace` printOp op `beforeWithSpace` prettyPrintValue (d - 1) rhs
98 printOp (Op (Qualified _ name)) = text $ T.unpack $ runOpName name
98 printOp (Op (Qualified _ name)) = text $ T.unpack $ runOpName name
99− printOp expr = text "`" <> prettyPrintValue (d - 1) expr <> text "`"
99+ printOp expr = text "`" <> prettyPrintValue (d - 1) expr `before` text "`"
100prettyPrintValueAtom d (TypedValue _ val _) = prettyPrintValueAtom d val
100prettyPrintValueAtom d (TypedValue _ val _) = prettyPrintValueAtom d val
101prettyPrintValueAtom d (PositionedValue _ _ val) = prettyPrintValueAtom d val
101prettyPrintValueAtom d (PositionedValue _ _ val) = prettyPrintValueAtom d val
102prettyPrintValueAtom d (Parens expr) = (text "(" <> prettyPrintValue d expr) `before` text ")"
102prettyPrintValueAtom d (Parens expr) = (text "(" <> prettyPrintValue d expr) `before` text ")"