Subtype constraints in interfaces
问题 I want to compose several "traits" across several modules. A function might require multiple such "traits" as its input, i.e.: type 'a x_t = < get_x : int ; .. > as 'a constraint 'a = < get_b : float ; .. > val foo : x_t -> float composing these traits manually in the interface is cumbersome and error-prone, but perfectly possible. But in an ideal world, I should be able to use the "trait's" name instead of manually composing all the required fields, i.e. write something like: type 'a x_t = <