ormolu-0.1.2.0: A formatter for Haskell source code

Safe Haskell | None
Language | Haskell2010

Ormolu.Diff

Description

Diffing GHC ASTs modulo span positions.

Synopsis

- data Diff
  - = Same
  - | Different [SrcSpan]
- diffParseResult :: ParseResult -> ParseResult -> Diff
- diffText :: Text -> Text -> FilePath -> Maybe (RealSrcLoc, Text, Text)

# Documentation

data Diff Source #

Result of comparing two `ParseResult`s.

Constructors

Same | Two parse results are the same
Different [SrcSpan] | Two parse results differ

#### Instances

Instances details

Semigroup Diff Source # |
Instance details Defined in Ormolu.Diff Methods (<>) :: Diff -> Diff -> Diff Source # sconcat :: NonEmpty Diff -> Diff Source # stimes :: Integral b => b -> Diff -> Diff Source #
Monoid Diff Source # |
Instance details Defined in Ormolu.Diff Methods mempty :: Diff Source # mappend :: Diff -> Diff -> Diff Source # mconcat :: [Diff] -> Diff Source #

diffParseResult :: ParseResult -> ParseResult -> Diff Source #

Return `Diff` of two `ParseResult`s.

diffText Source #

Arguments

:: Text | Text before
-> Text | Text after
-> FilePath | Path to use to construct `RealSrcLoc`
-> Maybe (RealSrcLoc, Text, Text) |

Diff two texts and return the location they start to differ, alongside with excerpts around that location.