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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 205E97EF5E for ; Fri, 15 Jul 2016 21:26:29 +0200 (CEST) IronPort-PHdr: 9a23:H4s+5hFNYSjZGpCBXm5Y4Z1GYnF86YWxBRYc798ds5kLTJ74pciwAkXT6L1XgUPTWs2DsrQf2rKQ7/yrADZaqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ3pzxi7z5oseJKyxzxxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjMD39DwrRTIUSeI43IdVC1WzksJUED560TLWYv4t2PQv/B73zjSadzxUbkxUz246aB6YBDtgSYDcTU+9TeTwu59lq9esVqQrhh7xJacNJCcMP55ZovSeNobQSxKWcMHBAJbBYbpJasCHecCPO9Y56y773AHtwevT0H4BO794mdPhTnxx6JsgLdpKh3PwAF1R4FGi3/TttigcfpLXA== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=hez@0ok.org; spf=None smtp.mailfrom=hez@0ok.org; spf=None smtp.helo=postmaster@homiemail-a80.g.dreamhost.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hez@0ok.org) identity=pra; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="hez@0ok.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hez@0ok.org) identity=mailfrom; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="hez@0ok.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@homiemail-a80.g.dreamhost.com) identity=helo; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="postmaster@homiemail-a80.g.dreamhost.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CjAAAtOIlXh4HIcdBchBR8pAEBAQaDMoUfhxaGfyKFeAKBaxABAQEBAQEBAREBAQEIDQkJIS+CMgQBEoITAQEEARIRHS4LAQQLCwQHDQ0dAgIhARIBBQEKEgYBEhIQh3QDDwgOo0CBMT4xizuESoUzAwqEGgEBAQEBAQEDAQEBAQEBAQEBAQEUCIQfgUOFFYJDgVpQglSCWoZaDJIMNAGGEoYxgheCOYx8iCKGOjCBDw8mgjuBV26FEIFDAQEB X-IPAS-Result: A0CjAAAtOIlXh4HIcdBchBR8pAEBAQaDMoUfhxaGfyKFeAKBaxABAQEBAQEBAREBAQEIDQkJIS+CMgQBEoITAQEEARIRHS4LAQQLCwQHDQ0dAgIhARIBBQEKEgYBEhIQh3QDDwgOo0CBMT4xizuESoUzAwqEGgEBAQEBAQEDAQEBAQEBAQEBAQEUCIQfgUOFFYJDgVpQglSCWoZaDJIMNAGGEoYxgheCOYx8iCKGOjCBDw8mgjuBV26FEIFDAQEB X-IronPort-AV: E=Sophos;i="5.28,369,1464645600"; d="scan'208,217";a="184939829" Received: from sub5.mail.dreamhost.com (HELO homiemail-a80.g.dreamhost.com) ([208.113.200.129]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Jul 2016 21:26:27 +0200 Received: from homiemail-a80.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a80.g.dreamhost.com (Postfix) with ESMTP id DC44337A07A for ; Fri, 15 Jul 2016 12:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=0ok.org; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc: content-type; s=0ok.org; bh=hbaF9wiz/v/mJB661zpn3c1WpJk=; b=F5dm dL0CtHYw6M/TdWYujt6uHqciJmLNDRN7Njbu2e3T6Md+uspjcx7xByUodfJzVvPP bIpw8q+X9KXZIBPMpxCVbxhylCUYgjyA9MUtnL3Uxwj+1RtNsz42XLnnSHFPnm/o h8ehVMxwvrOfxGsGx720S09qUfcxnGiGf23iKIw= Received: from mail-vk0-f48.google.com (mail-vk0-f48.google.com [209.85.213.48]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: hez@0ok.org) by homiemail-a80.g.dreamhost.com (Postfix) with ESMTPSA id C979C37A078 for ; Fri, 15 Jul 2016 12:26:24 -0700 (PDT) Received: by mail-vk0-f48.google.com with SMTP id w127so110013024vkh.2 for ; Fri, 15 Jul 2016 12:26:24 -0700 (PDT) X-Gm-Message-State: ALyK8tIHdRGOslq5w/Va6PnQ4nU4oZ0Stii3moX21J2mEQOBLF/WzZYwgQCeEdmCel2vPRYfJg/P4GePkjME7A== X-Received: by 10.31.8.83 with SMTP id 80mr11627239vki.93.1468610784061; Fri, 15 Jul 2016 12:26:24 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <6650375677998504317@unknownmsgid> From: "Hezekiah M. Carty" Date: Fri, 15 Jul 2016 19:26:14 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Yotam Barnoy , Jeremy Yallop Cc: Hendrik Boom , Ocaml Mailing List Content-Type: multipart/alternative; boundary=001a1145542e1904bf0537b19848 Subject: Re: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) --001a1145542e1904bf0537b19848 Content-Type: text/plain; charset=UTF-8 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 > --001a1145542e1904bf0537b19848 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 preprocessing.

Hez

On Fri, Jul 15, 2= 016 at 2:58 PM Yotam Barnoy <yo= tambarnoy@gmail.com> wrote:
= Ok I have to admit that's pretty convenient.

> 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
--001a1145542e1904bf0537b19848--