Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- diffOpts' :: forall ki codes phi at. (EqHO ki, DigestibleHO ki, DigestibleHO phi) => DiffOptions -> Holes ki codes phi at -> Holes ki codes phi at -> (Int, Delta (Holes ki codes (Sum phi (MetaVarIK ki))) at)
- diffOpts :: (EqHO ki, DigestibleHO ki, IsNat ix) => DiffOptions -> Fix ki codes ix -> Fix ki codes ix -> Patch ki codes ix
- diff :: (EqHO ki, DigestibleHO ki, IsNat ix) => MinHeight -> Fix ki codes ix -> Fix ki codes ix -> Patch ki codes ix
- data DiffMode
- module Data.HDiff.Diff.Types
Documentation
diffOpts' :: forall ki codes phi at. (EqHO ki, DigestibleHO ki, DigestibleHO phi) => DiffOptions -> Holes ki codes phi at -> Holes ki codes phi at -> (Int, Delta (Holes ki codes (Sum phi (MetaVarIK ki))) at) Source #
Diffs two generic merkelized structures. The outline of the process is:
i) Annotate each tree with the info we need (digest and height) ii) Build the sharing trie iii) Identify the proper shares iv) Substitute the proper shares by a metavar in both the source and deletion context v) Extract the spine and compute the closure.
diffOpts :: (EqHO ki, DigestibleHO ki, IsNat ix) => DiffOptions -> Fix ki codes ix -> Fix ki codes ix -> Patch ki codes ix Source #
When running the diff for two fixpoints, we can cast the resulting deletion and insertion context into an actual patch.
diff :: (EqHO ki, DigestibleHO ki, IsNat ix) => MinHeight -> Fix ki codes ix -> Fix ki codes ix -> Patch ki codes ix Source #
Diffing Algorithm modes. This is better illustrated with an example. Supposte we have the following source and destination trees:
src = Bin (Bin t k) u dst = Bin (Bin t k) t
DM_ProperShare | The proper share algorithm will only share the trees that are supposed to be a proper share. With the src and dst above, it will produce: diff src dst = Bin (Bin 0 1) u |-> Bin (Bin 0 1) 0 A good intuition is that this approach will prefer maximum sharing as opposed to sharing bigger trees. |
DM_NoNested | The first algoritm we produced. Does not share nested trees. In fact, with this mode we will get the following result: diff src dst = Bin 0 u |-> Bin 0 t |
DM_Patience | Similar to |
Instances
Enum DiffMode Source # | |
Eq DiffMode Source # | |
Show DiffMode Source # | |
module Data.HDiff.Diff.Types