So, is there any way I can use Set as a field in records?
Indeed, this kind of declaration is more like object-oriented style, but considering my block may have many fields to store, it seems dump them into one record is a natural way.
Which Set are you using? If it’s the standard library’s set, then you would actually create a module: module IntSet = Set.Make(Int). Then you can use IntSet.t as a type: