From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 9FB2C7EEFD for ; Thu, 1 Oct 2015 23:42:01 +0200 (CEST) IronPort-PHdr: 9a23:KHmP/BKhfyyvLpqkndmcpTZWNBhigK39O0sv0rFitYgULfjxwZ3uMQTl6Ol3ixeRBMOAu64C1bGd6/mocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC04LpjKvqotX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD89pozcNLUL37cqIkVvQYSW1+ayFmrPHs4DLKSA/HwnoHTi1CmRNNB03B7Qrmdpb3qCrz8ORnjnq0J8rzGJkvWTW57+9CRxbyly4Df2ow/2jNlcV01fME/TquohV+x8jfZ4TDZ6k2Rb/UYd5PHTkJZc1WTSEUR9rkN4Y= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=agarwal1975@gmail.com; spf=Pass smtp.mailfrom=agarwal1975@gmail.com; spf=None smtp.helo=postmaster@mail-wi0-f177.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.212.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.212.177 as permitted sender) identity=mailfrom; client-ip=209.85.212.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f177.google.com) identity=helo; client-ip=209.85.212.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-wi0-f177.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CyAQCWpw1Wm7HUVdFehGkGgyWuT5UsBzsRAQEBAQEBAQEQAQEBAQEGCwsJIS6CHYF+IhEdARseAxIIAQIFNwIkAREBBQEWDBsah3YBAxKnXoIFgTA+MYtHgWyCeYoEChknDVaEXQEFDpNggUMFlXIHjRSaBxIjgRc3glOBdyIziXgBAQE X-IPAS-Result: A0CyAQCWpw1Wm7HUVdFehGkGgyWuT5UsBzsRAQEBAQEBAQEQAQEBAQEGCwsJIS6CHYF+IhEdARseAxIIAQIFNwIkAREBBQEWDBsah3YBAxKnXoIFgTA+MYtHgWyCeYoEChknDVaEXQEFDpNggUMFlXIHjRSaBxIjgRc3glOBdyIziXgBAQE X-IronPort-AV: E=Sophos;i="5.17,619,1437429600"; d="scan'208";a="149325547" Received: from mail-wi0-f177.google.com ([209.85.212.177]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 01 Oct 2015 23:42:00 +0200 Received: by wiclk2 with SMTP id lk2so9368121wic.0 for ; Thu, 01 Oct 2015 14:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=uamRfCySnYg0Rc2AGNpO8VJhZylHoeJAME6QZBd5Orc=; b=H3dLH/TnGUf0nuIW2vpeH+k+IcGIb2oBE66GInxNYIjTMZX521nhzNFbCWVXetWmaz 5Z6FWmEubPRdbhZaoLzvgygwexL3Bbz53Pl7ziKdMRIQV1yAKrb58uBitxGPdgvOFbKJ IOloWxRxmet9C4c2PTidImEqgTTacG+Q/AE5QeXEp9PWN5rD5mMDbPCqIXV2lej6UMPI yqDzKmcZuG4fKdi4j5d6Y2eKoyo9GlsEomLf7foSm5+gXfw810prYBdfNJCA/kWCtLBh mUfw/9e6zxmyhzEQSAsXPTkur7fgKpQuy7if99sLhA4VCsowX+UqsTo0V4cr5VIyR6w6 i9WA== X-Received: by 10.194.76.67 with SMTP id i3mr14317105wjw.5.1443735720423; Thu, 01 Oct 2015 14:42:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.82.86 with HTTP; Thu, 1 Oct 2015 14:41:40 -0700 (PDT) From: Ashish Agarwal Date: Thu, 1 Oct 2015 17:41:40 -0400 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=047d7bdc87aac3f979052111ea0e Subject: [Caml-list] type synonym for polymorphic variant --047d7bdc87aac3f979052111ea0e Content-Type: text/plain; charset=UTF-8 I've been doing this in some code for years: type s = [`A | `B] type t = [s] but just discovered it works only because the code was passing through camlp4. Without camlp4, it fails. You can try in utop with and without doing #camlp4o. Is there some way to get the above to work without camlp4? AFAICT, the grammar allows it, so the normal parser is wrong here. --047d7bdc87aac3f979052111ea0e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've been doing this in some code for years:

type s =3D [`A | `B]
type t =3D [s]

but just discovered it works only because the code was passing throug= h camlp4. Without camlp4, it fails. You can try in utop with and without do= ing #camlp4o.

Is there some way to get the above t= o work without camlp4? AFAICT, the grammar allows it, so the normal parser = is wrong here.

--047d7bdc87aac3f979052111ea0e--