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 3A6A87F712 for ; Sat, 25 Jan 2014 21:11:03 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of nicolas.braudsantoni@gmail.com) identity=pra; client-ip=74.125.83.52; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.braudsantoni@gmail.com"; x-sender="nicolas.braudsantoni@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of nicolas.braudsantoni@gmail.com designates 74.125.83.52 as permitted sender) identity=mailfrom; client-ip=74.125.83.52; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.braudsantoni@gmail.com"; x-sender="nicolas.braudsantoni@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-ee0-f52.google.com) identity=helo; client-ip=74.125.83.52; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.braudsantoni@gmail.com"; x-sender="postmaster@mail-ee0-f52.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucBABYa5FJKfVM0m2dsb2JhbABag0S9IoEJFg4BAQEBAQYLCwkUKIIlAQEBBCcZARscAgMMBgULDQkWDwkDAgECARERAQUBHBMIAQEXh1UBAxEEAQigAYxcgwmScAoZJw1khHIRAQEEDI8IFoQiBJA9gTKGOIZHiWpBhFo X-IPAS-Result: AucBABYa5FJKfVM0m2dsb2JhbABag0S9IoEJFg4BAQEBAQYLCwkUKIIlAQEBBCcZARscAgMMBgULDQkWDwkDAgECARERAQUBHBMIAQEXh1UBAxEEAQigAYxcgwmScAoZJw1khHIRAQEEDI8IFoQiBJA9gTKGOIZHiWpBhFo X-IronPort-AV: E=Sophos;i="4.95,720,1384297200"; d="asc'?scan'208";a="54839974" Received: from mail-ee0-f52.google.com ([74.125.83.52]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 25 Jan 2014 21:10:44 +0100 Received: by mail-ee0-f52.google.com with SMTP id e53so1551017eek.39 for ; Sat, 25 Jan 2014 12:10:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=oK7Bt99j4iTVFbludX956E6dFI0W8K7TltX0CBOKDwo=; b=BdXRLTVGuCCb+eYEomVV0HvjNrZub0Ng5/TL99ZdJQ5jHesOwEZL4obMaKyToaZNXE FRSlxXjto4KtjMS0M6RkymRNZiB5oomcDkikJHmxW4M4il7IyyQPEmuGjrCIU7y3di7h yp0Xj92Mt1Tb3aMNieLVMfi8mFAb8Sauk+Izay2UfgSigDg1HcE6BbW4YThXgs3RGn6Q pBmZqVfFnHBi4VTis6FAiVZmsXm6xmWd3O5HkT34ESSgzgrcqrFTv72Eex4HUyXJiNSc 1TFpuzaoPvXLNFdGYhDu7wgVtwRjgUZH9gWD1UoGqRlf1Pl34FwMw7aH+r2Dz89alDOt RtXw== X-Received: by 10.15.111.6 with SMTP id ci6mr14404172eeb.59.1390680643823; Sat, 25 Jan 2014 12:10:43 -0800 (PST) Received: from [78.104.82.225] (p-225.vc-graz.ac.at. [78.104.82.225]) by mx.google.com with ESMTPSA id l4sm19824504een.13.2014.01.25.12.10.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Jan 2014 12:10:42 -0800 (PST) Message-ID: <52E41A3A.3020307@gmail.com> Date: Sat, 25 Jan 2014 21:10:34 +0100 From: Nicolas Braud-Santoni User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <52E404ED.80302@gmail.com> In-Reply-To: <52E404ED.80302@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="To2TsGD8RPLfRfRctW4tjuuod118qdOAP" Subject: Re: [Caml-list] ocaml{c,opt} choked This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --To2TsGD8RPLfRfRctW4tjuuod118qdOAP Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 25/01/2014 19:39, Matej Kosik wrote: > Hi, > > I am using ocaml 4.01.0. > > I have noticed the following strange behavior: > [...] > > I would like to ask: is this is a known phenomenon? > ------------------------------------------------------------------- > The context: > > I have started to apply the advice given here: > https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00207.html > That way I've got terms with which ocaml{c,opt} struggles. Hi, It is a well-known problem that type inference is exponential-type[0] This worst-case behaviour is triggered when you have deeply nested -> in the types. For an example, consider : let f x y =3D y x x in let g x =3D f (f x) in let h x =3D g (g x) in let h x =3D h (h x) in let h x =3D h (h x) in h;; (* This actually causes a stack overflow *) Unfortunately, there isn't (as far as I know) a silver bullet. Avoiding deep nesting of combinators mights be a solution, though. I usually also helps with readability. Regards, Nicolas [0] under ETH, probably, but I don't currently remember. --To2TsGD8RPLfRfRctW4tjuuod118qdOAP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJS5Bo/AAoJEPv4tP2UoeSeDgEQAIRRXX+z8Y74fg3xgj7ZE5hn I6BvsDXZNAMj+H0hanqHTVSYYIHczDklEatyK8dvwYz0b7mc+nLaIhZxO+REOYTU hmTSTRDkXlnurj5gK0a3j0XTYrGkRy3eaSF3zvOhqiKhUQW9K4gGfg3qyiD6Xh4K c8v4S2Z0q9t1gUfhpqxnz+TFOHJGotL/60WsJhLa6Oig8q3DdwvxVVl0EYJmf35U dnFu5xTtQceiUSsXyprLTDCyhH4J65gUtJR6qQIQKFjMNBZeibswHAbNDsbdjNxw 2GcbOGU3hReKwpSKBGTeku5rntnmcysY1NgOSMzJSc8aOX1adtTwRhIWRAPXYVGY LFNmrrC5iqFRLDe64qakvn4cVT+Sp2o/+ulLtX9RKZGNU7jN5GpCBCvjO7OJcnxR vDqMbtPGnXlUTcmJDg1XpBygy7Ot9VLBTN+9wAuGOQw66gKY6Vd6Z1DaO4ERwE1z qInG2ygnbqEVfatIK/SNC2HPpHxhPy0AGkOAsZTycHPNCeo/bXVLp0V09e2dLAJs CUt8Labx8WmRhE3ag2P47Cmr/YN2LqpBmdjifXutBjlc2zRupwHblJRqP8ocO6Ny Q7do+pTCZJ7yfx18acNYPBLehIiKpA1Qicb5mkHfHnPbsmm/BKJn+jUvM5DZXKRb 0zqP+hVnjHiQULXcabwY =0I2Q -----END PGP SIGNATURE----- --To2TsGD8RPLfRfRctW4tjuuod118qdOAP--