2019-10-22 19:28:13 -07:00
|
|
|
(* Test set operations in CameLIGO *)
|
|
|
|
|
2019-10-29 20:33:18 -07:00
|
|
|
let add_op (s : string set) : string set =
|
|
|
|
Set.add "foobar" s
|
|
|
|
|
|
|
|
let remove_op (s : string set) : string set =
|
|
|
|
Set.remove "foobar" s
|
|
|
|
|
|
|
|
let remove_deep (s : string set * nat) : string set * nat =
|
|
|
|
Set.remove "foobar" s.(0)
|
|
|
|
|
|
|
|
(*
|
|
|
|
let patch_op (s: string set) : string set =
|
|
|
|
begin patch s with set ["foobar"]; end with s
|
|
|
|
|
|
|
|
let patch_op_deep (s: string set * nat) : string set * nat =
|
|
|
|
begin patch s.0 with set ["foobar"]; end with s
|
|
|
|
*)
|
|
|
|
|
|
|
|
let mem_op (s : string set) : bool =
|
|
|
|
Set.mem "foobar" s
|
|
|
|
|
2019-10-22 19:28:13 -07:00
|
|
|
let size_op (s: string set) : nat =
|
|
|
|
Set.size s
|