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 146EA7EF1E for ; Tue, 19 Jul 2016 18:37:50 +0200 (CEST) IronPort-PHdr: 9a23:CBI5oRL5ICjCRls2V9mcpTZWNBhigK39O0sv0rFitYgULf/xwZ3uMQTl6Ol3ixeRBMOAuqoC1rOd4vGocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+kQsiP1o/mhqibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LOg87KHg479HHshzKTA3HpidNEzYTkwFTAg7KpC3dFpnwvy/2/qomgGjJdePsSrVhaDO+5qIjYhbyjiAWf2oo933ej8Z5lqRcsTquohV+x8jfZ4TDZ6k2Rb/UYd5PHTkJZc1WTSEUR9nlYg== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yotambarnoy@gmail.com; spf=Pass smtp.mailfrom=yotambarnoy@gmail.com; spf=None smtp.helo=postmaster@mail-yw0-f176.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.161.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.161.176 as permitted sender) identity=mailfrom; client-ip=209.85.161.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; 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@mail-yw0-f176.google.com) identity=helo; client-ip=209.85.161.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yw0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AoCABOVo5XhrChVdFdhBVwDAaILp5+kzQihXgCKIEBBzsRAQEBAQEBAQERAQEBCAsLCSEvgjIEARKCCwkBBRIRBBkBGxILAQMMBgULDQICCR0CAiEBAREBBQEKEhkSEIVQgiMBAxcOoQeBMj4xizuBaoJaBYREChknAwpSg0wBAQEBBgEBAQEBARkCBhBxhSmETYJDgVkkgwEQgkoFhlYMkg40hhOGMYIegjmMfoglhjoSHoEPNII8gXMgMoZhgUQBAQU X-IPAS-Result: A0AoCABOVo5XhrChVdFdhBVwDAaILp5+kzQihXgCKIEBBzsRAQEBAQEBAQERAQEBCAsLCSEvgjIEARKCCwkBBRIRBBkBGxILAQMMBgULDQICCR0CAiEBAREBBQEKEhkSEIVQgiMBAxcOoQeBMj4xizuBaoJaBYREChknAwpSg0wBAQEBBgEBAQEBARkCBhBxhSmETYJDgVkkgwEQgkoFhlYMkg40hhOGMYIegjmMfoglhjoSHoEPNII8gXMgMoZhgUQBAQU X-IronPort-AV: E=Sophos;i="5.28,390,1464645600"; d="scan'208";a="227185326" Received: from mail-yw0-f176.google.com ([209.85.161.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 19 Jul 2016 18:37:48 +0200 Received: by mail-yw0-f176.google.com with SMTP id r9so21380674ywg.0 for ; Tue, 19 Jul 2016 09:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=U7VlEl2eFUAQQWN2U5+sepOdJiIFpBDxb8/qF8IxRRI=; b=uMxlj730oIw72FGltlnzLj7N/il2t7QnWwWhxNMgTGDyED9upr7LHbru7YxYVb7LMS NIaOtXLaarII2TOK3NdWGu7WCFjvoTmsc3iFUXT3DtqIaeAwJsgD4/tH7NvX3YgeViZa w1Sc0M8AaXyesYPiXiZHHy96uHzkTnVTBodIwEl9Nd5JsU9lFA9mij90JzbYfSOVn1bd t+8KNKU8iHcRylqABu9ALKbBeM+HYgbkkpuiB3SWHg0kVjMwrVr4XlKyYdVtPRvgkWSE m7g1UmQ3svMxhDcFAFw/fheLvbk8N3XpHvoQFzdXLFWUUQhKy/RuAIiQTMxbINe+CNvf g+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=U7VlEl2eFUAQQWN2U5+sepOdJiIFpBDxb8/qF8IxRRI=; b=JD3RKD6+CRKhtrQAIEPBk7PxqghJ701EY342x5McbOOZ8eLLFT3LNtVqUIdUkn81Ip TCuF9Zt7Z9t5cG0ALPv7ldDAK9GS/EbqxrniTXolutvQHlyNXsDq9TdJfUQjYRo3ebI/ WpcXlYfte9Zz8oCZHhOqzhXg4aXmNUvvL1uVMMr5ndXMau3D9OfqhvAKSeaTB4C+6HhO ZADVw2h+Q44Nkk57a/59dvFwH75myvB1Sr9AbhjOw6Paavl81eann1Tk5zWEEtPrBFgi A8KftCLLP6BMTDnZ28HcT0VsRXyCgIPsCua2KrzdRBreq1Ed2Nql7x34YGVKub3bqq+c K/iQ== X-Gm-Message-State: ALyK8tKwhgdeh7aDLU4H3LRlUUzOnV0asNIYiGG88Gea1t8EezOD7BrJ3IBMr99ObtYOirpj4upN9Ef6DBoKtg== X-Received: by 10.13.250.196 with SMTP id k187mt1819080ywf.314.1468946267207; Tue, 19 Jul 2016 09:37:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.214.204 with HTTP; Tue, 19 Jul 2016 09:37:27 -0700 (PDT) In-Reply-To: References: <001701d1daa2$30f7ac30$92e70490$@metastack.com> <1468179914.25014.89.camel@e130.lan.sumadev.de> <20160714090300.GB21053@frosties> <002601d1de7e$9f5776d0$de066470$@metastack.com> <20160715161308.GB30333@topoi.pooq.com> From: Yotam Barnoy Date: Tue, 19 Jul 2016 12:37:27 -0400 Message-ID: Cc: caml users , Jeremy Yallop Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) Jeremy, how about taking a page from haskell, and having type t =3D A.t(..) This would import the same constructors locally. It also means we have the full functionality covered, in terms of both opens and creating limited local modules: haskell: import A(foo, bar, T(..)) ocaml: let foo, bar =3D A.(foo, bar) type t =3D A.t(..) haskell: import qualified LongA(foo, bar, T(..)) as A ocaml: module A =3D struct LongA.(let foo, bar =3D foo, bar type nonrec t =3D t(..= )) end It's still more verbose (especially the limited-qualified module) but at least it's decent. On Sat, Jul 16, 2016 at 5:58 AM, vrotaru.md@gmail.com wrote: > > About that missing type constructors problem. Seems doable: > > module A =3D struct > module T =3D struct > type t1 =3D ... > type t2 =3D ... > end > include T > > let foo _ =3D ... > let bar : t2 -> t1 =3D ... > end > > module B =3D struct > > include A.T > let foo, bar =3D A.( foo, bar ) > > end > > Obviously, not for already existing code. > > =C3=8En s=C3=A2m., 16 iul. 2016 la 10:41, Petter A. Urkedal a > scris: >> >> On 15 July 2016 at 18:13, Hendrik Boom wrote: >> > And that's a real problem -- that fact that openning a module can fill >> > the namespace with lots of stray identifiers, which the user does not >> > control. >> >> Apart from the selective opens discussed, it would be good to tell >> apart which modules are meant to be open and which are intrusive >> without looking through them. Most importantly the writer of the >> library should be clear about it from the start when designing a >> module, then the names will be consistent with the choice, and users >> should be able to decide without evaluating the whole interface. >> >> A warning when opening an invasive module in a global scope could >> help, as well. One could maybe decide a module to be invasive from a >> few heuristics with fall-back to a declaration: >> >> - A module interface defining a single-letter identifier, most >> importantly a type "t" or a signature "S", is invasive. >> - A module interface overriding any operator (or identifier?) defined >> in Pervasives is invasive. >> - A module interface declaring itself `[@@@ocaml.invasive]` is invasive. >> >> Conversely the user may silence the warning with `open M >> [@@ocaml.invasive]`. >> >> -- >> 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