tree-diff-0.3.0.1: Diffing of (expression) trees.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.TreeDiff.Expr

Contents

Description

This module uses Expr for richer diffs than based on Tree.

Synopsis

Types

data Expr Source #

A untyped Haskell-like expression.

Having richer structure than just Tree allows to have richer diffs.

Constructors

App ConstructorName [Expr]

application

Rec ConstructorName (OMap FieldName Expr)

record constructor

Lst [Expr]

list constructor

Instances

Instances details
Arbitrary Expr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

arbitrary :: Gen Expr #

shrink :: Expr -> [Expr] #

Show Expr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

showsPrec :: Int -> Expr -> ShowS #

show :: Expr -> String #

showList :: [Expr] -> ShowS #

NFData Expr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

rnf :: Expr -> () #

Eq Expr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

(==) :: Expr -> Expr -> Bool #

(/=) :: Expr -> Expr -> Bool #

Ord Expr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

compare :: Expr -> Expr -> Ordering #

(<) :: Expr -> Expr -> Bool #

(<=) :: Expr -> Expr -> Bool #

(>) :: Expr -> Expr -> Bool #

(>=) :: Expr -> Expr -> Bool #

max :: Expr -> Expr -> Expr #

min :: Expr -> Expr -> Expr #

ToExpr Expr Source # 
Instance details

Defined in Data.TreeDiff.Class

type ConstructorName = String Source #

Constructor name is a string

type FieldName = String Source #

Record field name is a string too.

data EditExpr Source #

Type used in the result of ediff.

Instances

Instances details
Show EditExpr Source # 
Instance details

Defined in Data.TreeDiff.Expr

NFData EditExpr Source # 
Instance details

Defined in Data.TreeDiff.Expr

Methods

rnf :: EditExpr -> () #

data Edit a Source #

List edit operations

The Swp constructor is redundant, but it let us spot a recursion point when performing tree diffs.

Constructors

Ins a

insert

Del a

delete

Cpy a

copy unchanged

Swp a a

swap, i.e. delete + insert

Instances

Instances details
Show a => Show (Edit a) Source # 
Instance details

Defined in Data.TreeDiff.List

Methods

showsPrec :: Int -> Edit a -> ShowS #

show :: Edit a -> String #

showList :: [Edit a] -> ShowS #

NFData a => NFData (Edit a) Source # 
Instance details

Defined in Data.TreeDiff.List

Methods

rnf :: Edit a -> () #

Eq a => Eq (Edit a) Source # 
Instance details

Defined in Data.TreeDiff.List

Methods

(==) :: Edit a -> Edit a -> Bool #

(/=) :: Edit a -> Edit a -> Bool #

exprDiff :: Expr -> Expr -> Edit EditExpr Source #

Diff two Expr.

For examples see ediff in Data.TreeDiff.Class.