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 67B3A7FA5E for ; Wed, 19 Apr 2017 12:46:31 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=lwhite@janestreet.com; spf=Pass smtp.mailfrom=lwhite@janestreet.com; spf=None smtp.helo=postmaster@mxout3.mail.janestreet.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lwhite@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lwhite@janestreet.com"; x-sender="lwhite@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of lwhite@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lwhite@janestreet.com"; x-sender="lwhite@janestreet.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@mxout3.mail.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lwhite@janestreet.com"; x-sender="postmaster@mxout3.mail.janestreet.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ABXm7pBPbhTlgWE17C0ol6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0IvvyrarrMEGX3/hxlliBBdydsKMYzbKO+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1?= =?us-ascii?q?Ov71GonPhMiryuy+4ZPebgFHiTanfb9+MAi9oBn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us-ascii?q?47sxI2DoOtDYaLb5ukgfTV1TyyH7VXfSZBAVCFV37jMYecDaQiciWXd+tslXQ7?= =?us-ascii?q?Vbm9Rsd10Q6utRP347huKOfP5jcVuI6l399wsb6A3Sou/CB5WpzOm1qGSHt5yy?= =?us-ascii?q?ZVHjI=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DbAADOP/dYfeXIaSZcDg4BAQQBAQoBA?= =?us-ascii?q?RcBAQQBAQoBAYQKgQsHg2CKFZFjgjyTJoIPLIV4AoN1Bz8YAQEBAQEBAQEBAQE?= =?us-ascii?q?SAQEJFghXgjMigkEBAgIBIwQZAQEpAwsBBAsLBAcaHQICIhIBBQEKEgYTEolvA?= =?us-ascii?q?w0IAwueET+LHGiBbDqDCAEBBYQqA4NzAQEBAQEBAQMBAQEBAQEBAQEBFggShkG?= =?us-ascii?q?EdoUEgh8MLoJfh1sMgWOMd4ZxhwWLaYJViBmDb4JukkgUH4EVDxCBPUMgFUQYB?= =?us-ascii?q?oQPKoFRPnSJFQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0DbAADOP/dYfeXIaSZcDg4BAQQBAQoBARcBAQQBAQoBAYQ?= =?us-ascii?q?KgQsHg2CKFZFjgjyTJoIPLIV4AoN1Bz8YAQEBAQEBAQEBAQESAQEJFghXgjMig?= =?us-ascii?q?kEBAgIBIwQZAQEpAwsBBAsLBAcaHQICIhIBBQEKEgYTEolvAw0IAwueET+LHGi?= =?us-ascii?q?BbDqDCAEBBYQqA4NzAQEBAQEBAQMBAQEBAQEBAQEBFggShkGEdoUEgh8MLoJfh?= =?us-ascii?q?1sMgWOMd4ZxhwWLaYJViBmDb4JukkgUH4EVDxCBPUMgFUQYBoQPKoFRPnSJFQE?= =?us-ascii?q?BAQ?= X-IronPort-AV: E=Sophos;i="5.37,220,1488841200"; d="scan'208,217";a="220826086" Received: from mxout3.mail.janestreet.com ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 12:46:30 +0200 Received: from [172.27.56.68] (helo=tot-qpr-mailcore1) by mxout3.mail.janestreet.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1d0n80-0003pG-Kx for caml-list@inria.fr; Wed, 19 Apr 2017 06:46:28 -0400 X-JS-Flow: external X-JS-Scanner-attachment: (ok) No attachments Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BY90AE-AJzaTM-T-; 2017-04-19 06:46:28.643898-04:00 Received: from mail-io0-f197.google.com ([209.85.223.197]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1d0n80-0004qC-JR for caml-list@inria.fr; Wed, 19 Apr 2017 06:46:28 -0400 Received: by mail-io0-f197.google.com with SMTP id v34so11172865iov.22 for ; Wed, 19 Apr 2017 03:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2CrQTEnaNK/WQbfTGldn7ILCKcVR+IlfNLTVIqaW/i8=; b=Nh8DZeCut4LcjHwO4cE8IHkhaSYjbTyZcXd1EP9qpOuu/ezCNmdp+DV5T2R/+2/0TX jCD3oSfJMNYY05i3hew5yPJ6LxJRf1BqZ8bmWRs3fgkDO8ChVWAsBaztz50BEAI0HPu0 M2uHOwjq1NIPj4AG472TqqoxTPwpPY+JlXQMA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2CrQTEnaNK/WQbfTGldn7ILCKcVR+IlfNLTVIqaW/i8=; b=iTp/Z4yytYSoMi6vSDb3YCtzVysYAoWDrjCsb3K1ndYPPehRi2gyJGdx9E/20+evVT 6tzyfGyuP2gCChJ7q5u5uG3Rlb7BHCmSGrg/MjaF2xHcJfthDOxL9Hj6/Z4vapmYX7ah J+MlhezSEnyz/FVr2nl8QSOQTrZ58FXJoz9thGW77lHV/MaMTGOjuyryCtP2uqHjac74 xbJq3PwwLzjXTeoRNre3Jhyv7samgm5ghF7UeOrtwt3DeSB/zRQpjp27ooMHLMgzgdxN U+qo/+wtjs1H8kyxVjjMwrJ6+J3qa4E/CF78kYbHdKytJIfPnlovPiJMuu3SoHqm8Y3+ Dc0w== X-Gm-Message-State: AN3rC/4jCIv6miEVrTn43/dNgfcLtolCq+GDsszpLTPrT7MaXpXzqDhA kiyU0v3a82Rcf8GxjZAqcax9DMkK+IWtbUPsAxs9dSJJO0q7vyqhMHd+TSSzakr53R4xFPE92xi jNyc1isC/WXvb8jDq X-Received: by 10.107.44.71 with SMTP id s68mr2437125ios.126.1492598788254; Wed, 19 Apr 2017 03:46:28 -0700 (PDT) X-Received: by 10.107.44.71 with SMTP id s68mr2437108ios.126.1492598788090; Wed, 19 Apr 2017 03:46:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.4.131 with HTTP; Wed, 19 Apr 2017 03:46:27 -0700 (PDT) In-Reply-To: <20170419104058.GA63988@pllab.is.ocha.ac.jp> References: <20170419104058.GA63988@pllab.is.ocha.ac.jp> From:Leo White Date: Wed, 19 Apr 2017 11:46:27 +0100 Message-ID: To:Kenichi Asai Cc:caml users Content-Type: multipart/alternative; boundary=001a11399c908e95bc054d82bc0b X-JS-Processed-by: mailcore Subject: Re: [Caml-list] Question on "more general" --001a11399c908e95bc054d82bc0b Content-Type: text/plain; charset=UTF-8 Without looking too closely at your question I would assume that is just the value restriction. Regards, Leo On 19 April 2017 at 11:40, Kenichi Asai wrote: > Dear OCaml type inference experts, > > If I infer the type (using Typemod.type_structure) of: > > let a = 1 in fun x -> 1 > > and see if the type of x is more general (using Ctype.moregeneral) > than the type of a type variable (Btype.newgenvar ()), I obtain yes > (since the type of x is 'a which is more general (or equal) than a > newly created type variable, I guess). If I do the same for: > > let a = assert false in fun x -> 1 > > I obtain no, although it still seems that the type of x is the same > 'a. (See attached file for the concrete program I executed. I used > OCaml 4.04.0.) Why? > > Thank you in advance! > > -- > Kenichi Asai > > -- > 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 --001a11399c908e95bc054d82bc0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Without looking too closely at your question I would assum= e that is just the value restriction.

Regards,

Leo

On 19 April 2017 at 11:40, Kenichi Asai <= ;asai@is.ocha.ac.jp= > wrote:
Dear OCaml type in= ference experts,

If I infer the type (using Typemod.type_structure) of:

let a =3D 1 in fun x -> 1

and see if the type of x is more general (using Ctype.moregeneral)
than the type of a type variable (Btype.newgenvar ()), I obtain yes
(since the type of x is 'a which is more general (or equal) than a
newly created type variable, I guess).=C2=A0 If I do the same for:

let a =3D assert false in fun x -> 1

I obtain no, although it still seems that the type of x is the same
'a.=C2=A0 (See attached file for the concrete program I executed.=C2=A0= I used
OCaml 4.04.0.)=C2=A0 Why?

Thank you in advance!

--
Kenichi Asai

--
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/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a11399c908e95bc054d82bc0b--