Extending `open` to accept arbitrary module expression

Pull request of Extending OCaml’s open is now available for review here:

I would appreciate any review of this pull request or discussion about this extension.

5 Likes

When using an arbitrary module expression in either open or include, are there any subtleties with type identities? Is it easy to reason or understand, when types defined in such expressions are compatible with other types?

Can you explain a bit about “type identities” and “compatible”? Or better, can I have a concrete example?

Given a functor F to create modules X=F(A) and Y=F(B), when are abstract types X.t and Y.t identical such their values can be used interchangeably? Does using open and include affect the answer at all?