1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Turn the bind around.

This commit is contained in:
Rob Rix 2016-04-25 15:04:55 -04:00
parent 632d2cf86b
commit ce9be615a6

View File

@ -111,7 +111,7 @@ data PrettyDiff = PrettyDiff { unPrettySources :: Both (Source.Source Char), unP
deriving Eq
instance Show PrettyDiff where
show (PrettyDiff sources lines) = ('\n':) =<< (showLine (fromMaybe 0 (maximum (fmap length <$> shownLines))) <$> catMaybes shownLines)
show (PrettyDiff sources lines) = showLine (fromMaybe 0 (maximum (fmap length <$> shownLines))) <$> catMaybes shownLines >>= ('\n':)
where shownLines = toBoth <$> lines
showLine n line = let (before, after) = fromThese (replicate n ' ') (replicate n ' ') (runJoin (pad n <$> line)) in
before ++ " | " ++ after