aboutsummaryrefslogtreecommitdiffstats
path: root/src/Store/Query/Record.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Store/Query/Record.hs')
-rw-r--r--src/Store/Query/Record.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Store/Query/Record.hs b/src/Store/Query/Record.hs
index b00be27..d663716 100644
--- a/src/Store/Query/Record.hs
+++ b/src/Store/Query/Record.hs
@@ -5,6 +5,7 @@ module Store.Query.Record
lookup,
Records,
lookups,
+ union,
disjointUnion,
disjointUnions,
)
@@ -52,6 +53,11 @@ lookups f rs =
[v] -> Just v
(_ : _) -> throw (DuplicateField (toString f))
+union :: J.Value -> J.Value -> J.Value
+union (J.Object r) (J.Object s) =
+ J.Object (JM.unionWith union r s)
+union _ s = s
+
disjointUnion :: J.Value -> J.Value -> J.Value
disjointUnion (J.Object r) (J.Object s) =
J.Object (JM.unionWithKey disjointUnion' r s)