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 44B177EEEF for ; Tue, 23 Jun 2015 10:27:23 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of asai@is.ocha.ac.jp) identity=pra; client-ip=133.65.64.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="asai@is.ocha.ac.jp"; x-sender="asai@is.ocha.ac.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of asai@is.ocha.ac.jp designates 133.65.64.10 as permitted sender) identity=mailfrom; client-ip=133.65.64.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="asai@is.ocha.ac.jp"; x-sender="asai@is.ocha.ac.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@web.is.ocha.ac.jp) identity=helo; client-ip=133.65.64.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="asai@is.ocha.ac.jp"; x-sender="postmaster@web.is.ocha.ac.jp"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CvAQDwF4lVlwpAQYVbFoNOXwG/Roc8TAEBAQEBARIBAQEBAQgWB09BBYN1KHs0BSABBQFXiAwBBQilToMxPjGcbIVRCpBjgwGBFAWMfIcDhFiGeAGBfIw3iDg1gRUXgVhDHIFhYYJHAQEB X-IPAS-Result: A0CvAQDwF4lVlwpAQYVbFoNOXwG/Roc8TAEBAQEBARIBAQEBAQgWB09BBYN1KHs0BSABBQFXiAwBBQilToMxPjGcbIVRCpBjgwGBFAWMfIcDhFiGeAGBfIw3iDg1gRUXgVhDHIFhYYJHAQEB X-IronPort-AV: E=Sophos;i="5.13,664,1427752800"; d="scan'208";a="166803131" Received: from web.is.ocha.ac.jp ([133.65.64.10]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Jun 2015 10:27:02 +0200 Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by web.is.ocha.ac.jp (Postfix) with ESMTP id D667299608A for ; Tue, 23 Jun 2015 17:27:00 +0900 (JST) Received: by pactm7 with SMTP id tm7so2322903pac.2 for ; Tue, 23 Jun 2015 01:27:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=XgCQPyAE7QY3JjhYIIDu2LbXQoe3KaFzxZryxZpMMX0=; b=UEzgCznjg4dR4dpd/2/JkwMMrr20GLjGNfyM1zUQLNuv3mF/pjcEg4aByYBDF9k7EI iYCOLQMqlKrKSsS0zcxNwgJ8O4L3EPrvbJjvDbmI1gFhJZc5RVopFNO4o8xO9hMa7Pgh rj/tDCSAJMimOiXVC5hP5CL+rOn04y36CmlVL599zHSkq1feXzyU5npYl+WtaFNB09Sy 99yTXm5+aND809LIrpRrXxduGWU3pR+VAeM5mwMsP0h+kHofEJbFCANE6/KMEKK3pMUU u9x4XEcEovesc7Q/msEB6qcpLQenAThalJHHvB8wZJ+P2G2T6+o7gfx17vcLnxJTYqat 4QZQ== X-Gm-Message-State: ALoCoQlYfX9chQOrEHyrYHsg2j+nCk4aUI6krmerbgXyC0k8V8l3DnAsh8z6Fk7badNM+eUNtj/56VdfELsdnwe2MomM2n6MfmgTuKcBn9o+cD/5KgcnnXgPCOgF7oclCv/gqmcMlZh8 X-Received: by 10.70.128.104 with SMTP id nn8mr9127280pdb.28.1435048020484; Tue, 23 Jun 2015 01:27:00 -0700 (PDT) X-Received: by 10.70.128.104 with SMTP id nn8mr9127256pdb.28.1435048020336; Tue, 23 Jun 2015 01:27:00 -0700 (PDT) Received: from localhost ([133.65.65.2]) by mx.google.com with ESMTPSA id qa1sm22390170pab.0.2015.06.23.01.26.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 01:26:59 -0700 (PDT) Date: Tue, 23 Jun 2015 17:26:51 +0900 From: Kenichi Asai To: caml-list@inria.fr Message-ID: <20150623082651.GA5301@pllab.is.ocha.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [Caml-list] Labels at the module level? Using labeled arguments, one can supply default values for unspecified arguments: let f ?(x = 3) y = x * y in f 5 will return 15 without specifying the value of x at the second line. Is there a way to do a similar thing at the module level? Namely, I want to define a functor that accepts a module of sig: module type A_t = sig val x : int val y : int end but if the user did not specify some of the values in the signature, some default values will be used. Background: in the universe library for OCaml: http://pllab.is.ocha.ac.jp/~asai/Universe/ one specifies various handlers for events (such as tick, mouse, and key events). Currently, these handlers are registered to the big_bang function that accepts them using labeled arguments (with default values). I wonder if I can specify the interface as a module signature and let the user write a module of that signature but only those handlers that the user is interested in. -- Kenichi Asai