I’m kind of stuck trying to figure out how can I use Base.Set in a recursive type definition.
So what I basically want ot achieve is something like this:
type value =
| Integer of int
| Float of float
| String of string
| Boolean of bool
| Variable of string
| Set of value Base.Set.t
But Base.Set constructor needs and element type and a comparator type (
type ('elt, 'cmp) t ). Element type is a no brainer, but I have no idea how I can define a comparator type. Not to mention I would need a comparator which can work on this recursive type.
I found an answer for making it work with Stdlib.Set by using recursive modules, but Base.Set doesn’t really have a similiar working functor like Stdlib.Set does(