1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Add a function to convert These -> (,).

This commit is contained in:
Rob Rix 2016-04-25 14:14:05 -04:00
parent 98a7c049b2
commit f602dc90fe

View File

@ -122,3 +122,4 @@ instance Show PrettyDiff where
showDiff diff = toList . stripNewlines . Source.slice (getRange diff)
stripNewlines = fmap (\ c -> if c == '\n' then ' ' else c)
pad n string = showString (take n string) . showString (replicate (max 0 (n - length string)) ' ')
toBoth them = (uncurry both . fromThese (const (repeat ' ')) (const (repeat ' ')) . runJoin $ showDiff <$> them) <*> sources