diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/concepts/Condition.ml | 2 | ||||
| -rw-r--r-- | lib/concepts/Condition.mli | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/concepts/Condition.ml b/lib/concepts/Condition.ml index cc0f7a7..16f02d0 100644 --- a/lib/concepts/Condition.ml +++ b/lib/concepts/Condition.ml @@ -18,6 +18,8 @@ let condition name message ?parent props = |> Option.value ~default:BatMap.empty |> props } +let complement props ({properties; _} as condition) = {condition with properties= props properties} + let to_string_hum {name; message; properties; backtrace} = let properties' = properties diff --git a/lib/concepts/Condition.mli b/lib/concepts/Condition.mli index fba43e6..86c86fa 100644 --- a/lib/concepts/Condition.mli +++ b/lib/concepts/Condition.mli @@ -10,5 +10,8 @@ val empty : ps (** construct a condition out of a name, a message, a set of properties and an optional parent *) val condition : string -> string -> ?parent:condition -> ps -> condition +(** complement a condition with an extra set of properties *) +val complement : ps -> condition -> condition + (** print a condition to a human-readable string *) val to_string_hum : condition -> string |
