Copyright | Copyright © 2020 Lars Kuhtz <lakuhtz@gmail.com> |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
The difference algorithms uses the following identies on JSON Values:
- An array equals the same array with all Null entries removed.
- An object equals the same object with all Null valued properties removed.
Synopsis
- data Diff a
- diff :: Value -> Value -> Value
- resolve :: (Diff Value -> Value) -> Value -> Value
- merge :: Diff Value -> Value
- mergeLeft :: Diff Value -> Value
- mergeRight :: Diff Value -> Value
- resolveLeft :: Diff Value -> Value
- resolveOnlyLeft :: Diff Value -> Value
- resolveRight :: Diff Value -> Value
- resolveOnlyRight :: Diff Value -> Value
Documentation
Represent differences between two values
Instances
diff :: Value -> Value -> Value Source #
Merge two JSON values and annotate the result with the differences.
resolve :: (Diff Value -> Value) -> Value -> Value Source #
Resolve differences between two JSON values using the provided conflict resolution function.
Conflict Resoluation Strategies
merge :: Diff Value -> Value Source #
Merge all non-conflicting differences. Leave the conflict annotations in the result.
mergeLeft :: Diff Value -> Value Source #
Merge all differences. Pick the left value in case of a conflict.
mergeRight :: Diff Value -> Value Source #
Merge all differences. Pick the right value in case of a conflict.