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 DA5077EF5E for ; Fri, 15 Jul 2016 21:42:04 +0200 (CEST) IronPort-PHdr: 9a23:lODbkBUqIyLmr7rHOAQpHf1jRw3V8LGtZVwlr6E/grcLSJyIuqrYZh2Ht8tkgFKBZ4jH8fUM07OQ6PG4HzBcqs/a7DgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLHqvcGPKFwT2HKUWvBbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4gyLeVhOC7WcwVWAfkxwAQ1SUrUKyYpCk+Av3pOd+2SCadeiwBZs9Qyizpe8/SBL6oH8ANHg+6m6B2eJqi6cOkRW9rhk36YfOZoaEfK5veb/UeNkTX2xGT+5eUiVABsW3aI5ZXLlJBvpRs4So/whGlhC5HwT5Qb62xw== 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-f178.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.178; 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.178 as permitted sender) identity=mailfrom; client-ip=209.85.161.178; 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-f178.google.com) identity=helo; client-ip=209.85.161.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yw0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CqAAAdOolXhrKhVdFchBR8pzuBWodHihMihXgCgS87EQEBAQEBAQEBEQEBAQgLCwkhL4IyBAESghMBAQQBEhEdARsSCwEDAQsGBQQUDR0CAiECEQEFAQoSBhMSCQeHcwEDDwgOo0CBMT4xizuBaoJaBYRpChknAwpSg0gBAQEBBgEBAQEBARkCBhCGGoRNgkOBWlCCVIJaBYZVDJIMNIYThjGEUIx8iCKGOjCBDw8lgjyBcyAyhRCBQwEBAQ X-IPAS-Result: A0CqAAAdOolXhrKhVdFchBR8pzuBWodHihMihXgCgS87EQEBAQEBAQEBEQEBAQgLCwkhL4IyBAESghMBAQQBEhEdARsSCwEDAQsGBQQUDR0CAiECEQEFAQoSBhMSCQeHcwEDDwgOo0CBMT4xizuBaoJaBYRpChknAwpSg0gBAQEBBgEBAQEBARkCBhCGGoRNgkOBWlCCVIJaBYZVDJIMNIYThjGEUIx8iCKGOjCBDw8lgjyBcyAyhRCBQwEBAQ X-IronPort-AV: E=Sophos;i="5.28,369,1464645600"; d="scan'208,217";a="226831816" Received: from mail-yw0-f178.google.com ([209.85.161.178]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 15 Jul 2016 21:42:03 +0200 Received: by mail-yw0-f178.google.com with SMTP id v186so49446407ywd.0 for ; Fri, 15 Jul 2016 12:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:mime-version:in-reply-to:date:message-id:subject:to :cc; bh=sm5aIJmA5o9i3GP8ZqAGqOp9UeooJFJw+ilX824ju9w=; b=jm720ojUcdM3cgya8Zz7epF7ubEosuk0Ibpivf0FS0FzlA75fWS+wzLQIKu5eRxAhp X/McZwoJXmJ617RLYBfco8vykRlrBROJ66QI9jR0leAWSHEqD0z7EZqJqpu8V5Okov5k OFteDCIRGybaQ+JDk9KnWRXDyi46q3LT5NT2iJAxaXNhjerQKmek2fI1MgRSK0KO7aKc oBKFBpDTuPryDMv5rVVuxMJ+Z7eUb+l5MEoF1jRTYrsNWSHuWl9QwxU/IVV97zLSjY2e 9AOHkeRz3WMt81BlnQFGnTY4tcFrAYymCMVwngYbucNKYSe3H88cZ5rSWGvfCMNuh23x +CVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:from:mime-version:in-reply-to:date :message-id:subject:to:cc; bh=sm5aIJmA5o9i3GP8ZqAGqOp9UeooJFJw+ilX824ju9w=; b=hH2quOKiFw/l6l6nmGNlkK25zd2ny7oKWgivnGn9YMSphd663feOG+0za0mz3BgBHE 85535O0oWvTouC78fnbhTk2T96rcDBf+UvdMbw9ohwg6TnegeaAV2Gc56EEEf7p3CgBa NqPSpwa4g4dQvvCtwJkRXNo4pXKzf2Fm7/Erq9yWpNPRcH0QnoPUitObY4JobAPu9Qwr GYujOorCiZTEX7yz5rh1s66Zt1hLwOaPORXQrlo+sas1JVxoAYBYAI1tcPsn9n2jrJc8 qpv8XuZc6ONGY8uPgsnKAvLMDvrgB6pTZiku3giVaTaDTHwdOMpzfCzzLi9J4f/Sgh4R 1H8A== X-Gm-Message-State: ALyK8tIAj9Kwh8Yhw7eiQwrIt7Dw+J0PNfW3T5spkd63r2JGTscQ61tJTwKyrm89vAlrmsuH3ZDzxM3eA8zFTw== X-Received: by 10.13.216.22 with SMTP id a22mr11741001ywe.5.1468611722523; Fri, 15 Jul 2016 12:42:02 -0700 (PDT) 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> <6650375677998504317@unknownmsgid> From: Yotam Barnoy Mime-Version: 1.0 (1.0) In-Reply-To: Date: Fri, 15 Jul 2016 15:42:01 -0400 Message-ID: <-1959624052697932351@unknownmsgid> To: "Hezekiah M. Carty" Cc: Jeremy Yallop , Hendrik Boom , Ocaml Mailing List Content-Type: multipart/alternative; boundary=001a114e3e0808b9880537b1d06e Subject: Re: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) --001a114e3e0808b9880537b1d06e Content-Type: text/plain; charset=UTF-8 That's a great point. Without that last bit of functionality, this isn't really a solution to the problem. On Jul 15, 2016, at 3:26 PM, Hezekiah M. Carty wrote: type t = M.t does not bring M.t's constructors into scope. ppx_import ( https://github.com/whitequark/ppx_import) can help with this if you don't mind preprocessing. Hez On Fri, Jul 15, 2016 at 2:58 PM Yotam Barnoy wrote: > Ok I have to admit that's pretty convenient. > > > On Jul 15, 2016, at 2:09 PM, Jeremy Yallop wrote: > > > >> On 15 July 2016 at 17:57, Yotam Barnoy wrote: > >> In haskell, I can just say 'import A (foo, bar, baz, t)' to limit > >> exactly what I want to import. This is because haskell has a > >> half-baked module system that isn't nearly as powerful as OCaml's, > >> which allows it to create syntax that doesn't need to go anywhere but > >> at the toplevel. > >> > >> We need this functionality in OCaml, but the closest thing is to say > >> 'include struct let foo = A.foo let bar = A.bar let baz = A.baz type t > >> = A.t end' > > > > This can be written more succinctly: > > > > let foo, bar, baz = A.(foo, bar, baz) > > type t = A.t > > -- > 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 > --001a114e3e0808b9880537b1d06e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That's a great poin= t. Without that last bit of functionality, this isn't really a solution= to the problem.

On Jul 15, 2016, at 3:26 PM, Hezekiah M. Car= ty <hez@0ok.org> wrote:

type t =3D M.t does not = bring M.t's constructors into scope. =C2=A0ppx_import (https://github.com/whitequark/ppx_import) can help with this if you don't mind prep= rocessing.

Hez

=
On Fri, Jul 15, 2016 at 2:58 PM Yotam Barnoy <yotambarnoy@gmail.com> wrote:
<= /div>
Ok I have to admit that's pretty co= nvenient.

> On Jul 15, 2016, at 2:09 PM, Jeremy Yallop <yallop@gmail.com> wrote:
>
>> On 15 July 2016 at 17:57, Yotam Barnoy <yotambarnoy@gmail.com> wrote:
>> In haskell, I can just say 'import A (foo, bar, baz, t)' t= o limit
>> exactly what I want to import. This is because haskell has a
>> half-baked module system that isn't nearly as powerful as OCam= l's,
>> which allows it to create syntax that doesn't need to go anywh= ere but
>> at the toplevel.
>>
>> We need this functionality in OCaml, but the closest thing is to s= ay
>> 'include struct let foo =3D A.foo let bar =3D A.bar let baz = =3D A.baz type t
>> =3D A.t end'
>
> This can be written more succinctly:
>
>=C2=A0 =C2=A0let foo, bar, baz =3D A.(foo, bar, baz)
>=C2=A0 =C2=A0type t =3D A.t

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
--001a114e3e0808b9880537b1d06e--