From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pA9FoWYK027872 for ; Wed, 9 Nov 2011 16:50:33 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUCAAeguk7RVdivk2dsb2JhbABCgk2CMKUZCCIBAQEBCQkLCRQEIYFyAQEBBBICDx0BGxwCAwwGBQQHDQkWCwICCQMCAQIBEREBBQEcBgEMCAEBHqIfCosaR4JjhWM9iHACBQqIX4EWBIgMjBmGZIZhPYQO X-IronPort-AV: E=Sophos;i="4.69,484,1315173600"; d="scan'208,217";a="117911760" Received: from mail-qy0-f175.google.com ([209.85.216.175]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 09 Nov 2011 16:50:31 +0100 Received: by qyc1 with SMTP id 1so5731081qyc.6 for ; Wed, 09 Nov 2011 07:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=KzZvoyArExXX2XyPUVHnQY6j9SvMOVN+O9Vn94jGU6o=; b=vVya3tqkn2vZnnaQODQ1LsFjYNwG87PUztdvngq7RdK4oV/uTc2lQEFLSYJTkvqOwS xy9Ksonlk6Rg99Jfnc2io2yqjidxNImop0AFo2K687r/eEJ/BudjkbQjJYKP0c4W6+bQ 5NuqWLzuTXJXXRkRPg4wsA3eTTqKv21rnUfhg= Received: by 10.224.175.200 with SMTP id bb8mr2509718qab.69.1320853830046; Wed, 09 Nov 2011 07:50:30 -0800 (PST) Received: from page.encs.concordia.ca (page.encs.concordia.ca. [132.205.221.212]) by mx.google.com with ESMTPS id hf9sm5358566qab.16.2011.11.09.07.50.28 (version=SSLv3 cipher=OTHER); Wed, 09 Nov 2011 07:50:29 -0800 (PST) Message-ID: <4EBAA144.6050701@gmail.com> Date: Wed, 09 Nov 2011 10:50:28 -0500 From: Vincent Aravantinos User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Red Hat/3.1.15-1.el6_1 Thunderbird/3.1.15 MIME-Version: 1.0 To: caml-list@inria.fr, Cedric Cellier References: <1320823798.6647.2.camel@Nokia-N900> <4EBA9F1B.3060801@gmail.com> In-Reply-To: <4EBA9F1B.3060801@gmail.com> Content-Type: multipart/alternative; boundary="------------040204040907070604070300" Subject: Re: [Caml-list] Include question This is a multi-part message in MIME format. --------------040204040907070604070300 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/09/2011 10:41 AM, Vincent Aravantinos wrote: > I actually wonder if they just *look* too complicated? Maybe because > they are verbose? > Each time you define a functor you also have to give the signature of > its argument, which, compared to a simple "include" can look overkilling. > Concretely: > > module A = struct > ... > end > > module B = struct > include A > ... > end > > VS > > module A = struct > ... > end > > module type B_INPUT = sig > ... (can be big) > end > > module Make_B (X:B_INPUT) = struct > ... > end This verbosity problem is actually less true since 3.12 with the introduction of "module type of": module A = struct ... end module Make_B (X: module type of A) = struct ... end Which is then quite close to the "include" version. --------------040204040907070604070300 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 11/09/2011 10:41 AM, Vincent Aravantinos wrote:
I actually wonder if they just *look* too complicated? Maybe because they are verbose?
Each time you define a functor you also have to give the signature of its argument, which, compared to a simple "include" can look overkilling.
Concretely:

module A = struct
  ...
end

module B = struct
  include A
  ...
end

VS

module A = struct
  ...
end

module type B_INPUT = sig
  ... (can be big)
end

module Make_B (X:B_INPUT) = struct
  ...
end

This verbosity problem is actually less true since 3.12 with the introduction of "module type of":

module A = struct
  ...
end

module Make_B (X: module type of A) = struct
  ...
end

Which is then quite close to the "include" version.
--------------040204040907070604070300--