generics-mrsop-gdiff-0.0.2: Reimplementation of the gdiff algorithm for generics-mrsop

Safe HaskellNone
LanguageHaskell2010

Generics.MRSOP.STDiff

Synopsis

Documentation

apply :: forall ki codes ix iy. (IsNat ix, IsNat iy, EqHO ki) => Almu ki codes ix iy -> Fix ki codes ix -> Maybe (Fix ki codes iy) Source #

Applies a patch to an element

merge :: forall ki codes ix. (EqHO ki, IsNat ix) => Almu ki codes ix ix -> Almu ki codes ix ix -> Maybe (Almu ki codes ix ix) Source #

Merges two patches in the stdiff style. Satisfies the following postcondition:

if merge p q == Just pq && merge q p == Just qp
then apply pq . q == apply qp . p

diff Source #

Arguments

:: (EqHO ki, TestEquality ki, IsNat ix) 
=> Fix ki codes ix 
-> Fix ki codes ix 
-> Almu ki codes ix ix 

The interface function which witnesses thecomplete pipeline. its implementation is straightforward:

diff x y = let es = GDiff.diff' x y
               ax = countCopies $ annSrc  x es
               ay = countCopies $ annDest y es
            in diffAlmu ax ay