pretty-diff 0.1.0.0 → 0.2.0.0
raw patch · 2 files changed
+13/−13 lines, 2 files
Files
- pretty-diff.cabal +3/−3
- src/Pretty/Diff.hs +10/−10
pretty-diff.cabal view
@@ -4,11 +4,11 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4f4d19546099374e472ed7d6dd40094526c70cb5b1e0b7c2033232726b349f95+-- hash: 2a19208ef6c19864a9839c45c0707e57fd334d794ce6ab84c9251ffc5d88f9ac name: pretty-diff-version: 0.1.0.0-synopsis: Pretty printing a simple diff of two values.+version: 0.2.0.0+synopsis: Pretty printing a diff of two values. description: Please see the README at <https://github.com/stoeffel/pretty-diff>. category: Diffing homepage: https://github.com/stoeffel/pretty-diff#readme
src/Pretty/Diff.hs view
@@ -29,8 +29,8 @@ -- * pretty printing pretty,- actual,- expected,+ above,+ below, ) where @@ -99,24 +99,24 @@ -- | Printing a full diff of both values separated by some pipes. pretty :: Show a => Config -> a -> a -> Text pretty Config {separatorText, wrapping} x y =- [ actual wrapping x y,+ [ above wrapping x y, separator separatorText,- expected wrapping x y+ below wrapping x y ] & mconcat -- | Printing The first value and the diff indicator above. -- -- @--- Diff.actual Diff.NoWrap "1234" "_23"+-- Diff.above Diff.NoWrap "1234" "_23" -- @ -- -- @ -- ▼ ▼ -- "1234" -- @-actual :: Show a => Wrapping -> a -> a -> Text-actual wrapping x y =+above :: Show a => Wrapping -> a -> a -> Text+above wrapping x y = wrap wrapping [diffLine First down x y, Text.pack (show x)] & filterEmptyLines & Text.unlines@@ -124,15 +124,15 @@ -- | Printing The second value and the diff indicator below. -- -- @--- Diff.expected Diff.NoWrap "1234" "_23"+-- Diff.below Diff.NoWrap "1234" "_23" -- @ -- -- @ -- "_23" -- ▲ -- @-expected :: Show a => Wrapping -> a -> a -> Text-expected wrapping x y =+below :: Show a => Wrapping -> a -> a -> Text+below wrapping x y = wrap wrapping [Text.pack (show y), diffLine Second up x y] & filterEmptyLines & Text.unlines