caml-list - the Caml user's mailing list
 help / color / Atom feed
From: Thierry Martinez <>
To: Vadim <>
Cc: caml-list <>
Subject: Re: [Caml-list] How to shadow nested submodules?
Date: Fri, 11 Oct 2019 17:40:06 +0200 (CEST)
Message-ID: <> (raw)
In-Reply-To: <>

Hello, Vadim!

> Hello! I'm trying to figure out how shadow/override nested modules in
> OCaml.

A generic solution for old OCaml versions (<4.08) has been explained by
Gabriel Scherer in the following blog post:

The idea is to use destructive substitution while including the original

module Ipaddr = struct
  include (Ipaddr : module type of Ipaddr with module Prefix := Ipaddr.Prefix)

But I guess that the code you posted should work just fine with OCaml >=4.08
thanks to the following change:

Best regards.
Thierry Martinez.

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 15:24 Vadim
2019-10-11 15:40 ` Thierry Martinez [this message]
2019-10-11 16:09   ` Vadim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable:
	git clone --mirror
	git clone --mirror

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone