Closed olaure01 closed 3 years ago
I tried to use theta as set like you did but, the order is not guaranteed when calling elements
.
module Set_test = Set.Make(struct type t = string let compare = compare end);;
let a = Set_test.empty;;
let a = Set_test.add "hello" a;;
let a = Set_test.add "world" a;;
let a = Set_test.add "you" a;;
let a = Set_test.add "rock" a;;
Set_test.elements a;;
will print
- : Set_test.elt list = ["hello"; "rock"; "world"; "you"]
It is guaranteed to be ordered with respect to compare
:
https://ocaml.org/api/Set.S.html#VALelements
This should be enough here.
It is guaranteed to be ordered with respect to
compare
: https://ocaml.org/api/Set.S.html#VALelements This should be enough here.
Indeed, that's great simplification, you can have a look at my PR #77 now!
@etiennecallies is there still some code to be used from here, or should we close this PR?
Nope. Thanks for you work! Everything has been done on #77.
Ouch conflicts :confounded: I will take your ideas and apply them on my coed, there are good ones!