edits-0.1.1.0: show the differences between 2 pieces of Text using the Levenshtein distance
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Text.Difference

Description

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

Documentation

data Separators Source #

Separators are used to highlight a difference between 2 pieces of text for example

Constructors

Separators 

Instances

Instances details
Show Separators Source # 
Instance details

Defined in Data.Text.Difference

Eq Separators Source # 
Instance details

Defined in Data.Text.Difference

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