Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module provides data types and functions to display the difference between 2 strings according to the number of edit operations necessary to go from one to the other
Synopsis
- data Separators = Separators {}
- parensSeparators :: Separators
- bracketsSeparators :: Separators
- makeCharSeparators :: Char -> Char -> Separators
- data DisplayOptions = DisplayOptions {}
- defaultDisplayOptions :: DisplayOptions
- defaultDisplayEditOperations :: EditOperation Char -> Text
- coloredDisplayEditOperation :: EditOperation Char -> Text
- displayDiffs :: DisplayOptions -> [EditOperation Char] -> Text
Documentation
data Separators Source #
Separators are used to highlight a difference between 2 pieces of text for example
Instances
Show Separators Source # | |
Defined in Data.Text.Difference showsPrec :: Int -> Separators -> ShowS # show :: Separators -> String # showList :: [Separators] -> ShowS # | |
Eq Separators Source # | |
Defined in Data.Text.Difference (==) :: Separators -> Separators -> Bool # (/=) :: Separators -> Separators -> Bool # |
parensSeparators :: Separators Source #
Make parens separators
bracketsSeparators :: Separators Source #
Make brackets separators
makeCharSeparators :: Char -> Char -> Separators Source #
Make separators with simple Chars
data DisplayOptions Source #
Options to use for displaying differences
defaultDisplayOptions :: DisplayOptions Source #
Default display options
defaultDisplayEditOperations :: EditOperation Char -> Text Source #
Display an edit operation by prepending a symbol showing which operation is used
coloredDisplayEditOperation :: EditOperation Char -> Text Source #
Display an edit operation using ascii colors: green = added, red = removed, blue = substituted
displayDiffs :: DisplayOptions -> [EditOperation Char] -> Text Source #
Show the differences by enclosing them in separators Additionally shorten the text outside the separators if it is too long