From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8FDB17EE51 for ; Sat, 4 May 2013 14:23:18 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.87,611,1363129200"; d="scan'208";a="16035325" Received: from 69.24.87.79.rev.sfr.net (HELO [192.168.1.26]) ([79.87.24.69]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 04 May 2013 14:23:18 +0200 Message-ID: <5184FDB0.30406@inria.fr> Date: Sat, 04 May 2013 14:23:12 +0200 From: =?ISO-8859-1?Q?Micha=EBl_Lienhardt?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130422 Thunderbird/17.0.5 MIME-Version: 1.0 To: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] recursive module type Hello, I would like to define some recursive module type in caml, like module type S = sig ... module Toto(M : S) : sig ... end end More precisely, I'd like to extend the Set module available in the ocaml distribution with a function that convert a set into another set. Intuitively, I came up with the following signature S, which is not accepted by ocaml (Error: Unbound module type S): module type S = sig include Set.S module Convert : functor(SetTarget : S) -> sig val convert : (elt -> SetTarget.elt) -> t -> SetTarget.t end end Is there a way to define such a module type in ocaml, and if not, is there a theoretical reason for this not being possible? Thanks, Michael Lienhardt