Derive scalar changes and composition laws
This commit is contained in:
10 files changed
+527
-3
No files matched your search
+13
-1
@@ -35,7 +35,19 @@ let collection_of_list entries =
|
||||
|
||||
let collection_to_list map = Delta_runtime.Pure_map.bindings map
|
||||
|
||||
let equal (left : t) (right : t) = left = right
|
||||
let rec equal (left : t) (right : t) =
|
||||
match (left, right) with
|
||||
| VUnit, VUnit -> true
|
||||
| VInt a, VInt b -> a = b
|
||||
| VBool a, VBool b -> a = b
|
||||
| VString a, VString b -> a = b
|
||||
| VTuple a, VTuple b -> List.length a = List.length b && List.for_all2 equal a b
|
||||
| VRecord (name_a, fields_a), VRecord (name_b, fields_b) ->
|
||||
name_a = name_b
|
||||
&& List.length fields_a = List.length fields_b
|
||||
&& List.for_all2 (fun (label_a, value_a) (label_b, value_b) -> label_a = label_b && equal value_a value_b) fields_a fields_b
|
||||
| VCollection map_a, VCollection map_b -> Delta_runtime.Pure_map.equal equal map_a map_b
|
||||
| _ -> false
|
||||
|
||||
let field record label =
|
||||
match record with
|
||||
|
||||
Reference in new issue
Block a user