Using include instead of open would work, ie. turning your example into:
module Vec_main = struct
type t = { x: int; y: int }
let make x y = {x;y}
let add a b = {x=a.x+b.x; y=a.y+b.y}
end
module Vec = struct
include Vec_main
module Type = struct
include Vec_main
...
end
end
with:
-- Forwarded message --
From: Anthony Tavener anthony.tave...@gmail.com
Date: Wed, Nov 2, 2011 at 2:50 PM
Subject: Re: [Caml-list] Nested module exposing type from parent?
To: Vincent Aravantinos vincent.aravanti...@gmail.com
Actually, better than I initially thought...
I keep
On 11/02/2011 12:41 PM, Anthony Tavener wrote:
I've been struggling with this occasionally...
I'm using nested modules to open access to select features of a
module. My problem is I can't find a way to *expose* types in the parent
module through such nested modules.
A simplified example
Aha! That's more like what I was going for, Martin.
I didn't realize you could equate types in a chain like that, permitting
the definition of structure but also equality to another existing type.
That's good stuff.
This list, and OCaml, often amaze me... solutions keep getting better. :)
On