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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id B65EE7F1DD for ; Fri, 11 Jan 2013 06:14:16 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of siraaj@khandkar.net) identity=pra; client-ip=128.177.27.134; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="siraaj@khandkar.net"; x-sender="siraaj@khandkar.net"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of siraaj@khandkar.net) identity=mailfrom; client-ip=128.177.27.134; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="siraaj@khandkar.net"; x-sender="siraaj@khandkar.net"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@newcavia.khandkar.net) identity=helo; client-ip=128.177.27.134; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="siraaj@khandkar.net"; x-sender="postmaster@newcavia.khandkar.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsQAMie71CAsRuG/2dsb2JhbABEg0enTJFXBAKBCBZzgh4BAQQBOjQLBQsLJSFFEgYTEod1AwkGDK4HA4ZmkD5hA4hgjkaET4pegxM X-IronPort-AV: E=Sophos;i="4.84,449,1355094000"; d="scan'208";a="168073006" Received: from newcavia.khandkar.net ([128.177.27.134]) by mail4-smtp-sop.national.inria.fr with ESMTP; 11 Jan 2013 06:14:15 +0100 Received: from [10.0.1.31] (pool-108-46-62-235.nycmny.fios.verizon.net [108.46.62.235]) by newcavia.khandkar.net (Postfix) with ESMTPA id D76E555FF8; Fri, 11 Jan 2013 00:14:13 -0500 (EST) References: <50EF9E2B.1010100@riken.jp> In-Reply-To: <50EF9E2B.1010100@riken.jp> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Message-Id: Cc: caml-list X-Mailer: iPhone Mail (9B206) From: Siraaj Khandkar Date: Fri, 11 Jan 2013 00:14:11 -0500 To: Francois Berenger Subject: Re: [Caml-list] adding a function to an already existing module module MyList = struct include List let foo l = bar l end On Jan 11, 2013, at 0:07, Francois Berenger wrote: > Hello, > > Let's say I want to add a function to the List module > of the std lib. > > I'd like to do this without having to change list.ml > in the std lib. > > And, my function need to have access to everything available > in list.ml (constructors, type names, etc.). > > Is this possible and how to do this? > > For example, I want to create MyList, and this module > is the exact List module plus some functions of my own. > Then, some of my code would use MyList instead of List. > > Thanks a lot, > F. > > PS: a full copy-paste of list.ml is considered cheating ;) > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs