ormolu-0.7.1.0: A formatter for Haskell source code
Safe HaskellSafe-Inferred
LanguageGHC2021

Ormolu.Diff.Text

Description

This module allows us to diff two Text values.

Synopsis

Documentation

data TextDiff Source #

Result of diffing two Texts.

Instances

Instances details
Show TextDiff Source # 
Instance details

Defined in Ormolu.Diff.Text

Eq TextDiff Source # 
Instance details

Defined in Ormolu.Diff.Text

diffText Source #

Arguments

:: Text

Text before

-> Text

Text after

-> FilePath

Path to use

-> Maybe TextDiff

The resulting diff or Nothing if the inputs are identical

Diff two texts and produce a TextDiff.

selectSpans :: [RealSrcSpan] -> TextDiff -> TextDiff Source #

Select certain spans in the diff (line numbers are interpreted as belonging to the “before” state). Only selected spans will be printed.

printTextDiff :: TextDiff -> Term Source #

Print the given TextDiff as a Term action. This function tries to mimic the style of git diff.