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 8FD817EE34 for ; Sun, 27 Mar 2016 09:04:46 +0200 (CEST) IronPort-PHdr: 9a23:iQ3wBROfYboC9hqRmHgl6mtUPXoX/o7sNwtQ0KIMzox0KPryrarrMEGX3/hxlliBBdydsKIUzbCM+Pq+ACQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTnkbrosMeNOk1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCSV63QbSHRetxNMDgPF5VmuUZL4tibxtuNV1yyTPMmwRrcxD2eM9aBuHTvlj284Nz8l/SmDjsF3pKZDv0j84Rpy39iHM8muKPNic/aFLpshTm1bU5MUDnQZDw== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=leo@lpw25.net; spf=None smtp.mailfrom=leo@lpw25.net; spf=None smtp.helo=postmaster@out2-smtp.messagingengine.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=pra; client-ip=66.111.4.26; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=mailfrom; client-ip=66.111.4.26; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out2-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.26; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="postmaster@out2-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D5AACchfdWkhoEb0JdhH68aoYNAoEfPBABAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBBEA5AQ8LDhMlDwEEKCGIOgSvQYUtiBiDWQEKAQEBARUGGYpJihKXZQGOBoknhWSPCzeCP4FSa4hWAQEB X-IPAS-Result: A0D5AACchfdWkhoEb0JdhH68aoYNAoEfPBABAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBBEA5AQ8LDhMlDwEEKCGIOgSvQYUtiBiDWQEKAQEBARUGGYpJihKXZQGOBoknhWSPCzeCP4FSa4hWAQEB X-IronPort-AV: E=Sophos;i="5.24,399,1454972400"; d="scan'208";a="210480933" Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2016 09:04:45 +0200 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 902A220733 for ; Sun, 27 Mar 2016 03:04:44 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sun, 27 Mar 2016 03:04:44 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=lpw25.net; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=z9WUw b+B83n2WOrA+teSXHT0nvY=; b=T1OBqjPA8Z4223RvHNSlNOBbTvZppOn8QaokX 0AaDlnvNb7jPyTGZwfr+UfF/pjyic20xJKadnu5qulywzh4/sLDI39ALcwQ1zT6Q e4jz2/SThS3k44LS+bRDC8SrWfQDMI70wniJP6cK6O+G41FqHDTzzv9x0hpN8fCQ uM7ELI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=z9WUwb+B83n2WOrA+teSXHT0nvY=; b=Z/4S4 IePozaTK4t+r7u2h3WuYDoL0asVJLJb3FO21Um7p/mDfZFe/13ECtqXBasZ1UsRi YnofpzA0Zqd65zV7SrOTmydlMW48A42c/tnI6cIsz4OxPhBi0UvNNDyWpp2/tZIt bSvysFfXXjJ8DeWPWltWhcgHELT/We6iZDdt0s= X-Sasl-enc: 4WidMylBiFKegKnYnMg7eyXHsBWDD9Vv6DCAYpIE3xYZ 1459062284 Received: from netbook (cpc7-walt14-2-0-cust711.13-2.cable.virginm.net [213.106.2.200]) by mail.messagingengine.com (Postfix) with ESMTPA id 0A574C00013; Sun, 27 Mar 2016 03:04:43 -0400 (EDT) From: Leo White To: Gregory Malecha Cc: caml users References: X-Face: "XWxb[u_Z\PA_Y?9@|IA!!+jTb(/290-*ea/Un$I0B98.$n%eL.;2w*,z]WR#T:,p[ NBd++M7l]#7zj7!{~iw $W-"/=|dVjhT[D{4~gE}gK<2`.6fs!;uqqud]vs2N/3^m7{aS1V, Date: Sun, 27 Mar 2016 08:04:42 +0100 In-Reply-To: (Gregory Malecha's message of "Sat, 26 Mar 2016 23:19:34 -0700") Message-ID: <86d1qgqu45.fsf@lpw25.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] "Type constructor b would escape its scope" This is a guess since you didn't include the definition of stream_declarations, but I suspect that: > (* I have the following function, which seems to type check *) > let stream_declarations (type a) > : (internal_result,a) result_stream = ... is not polymorphic. The `(type a)` annotation ensures that `a` is abstract in the body of `stream_declarations` but does not enforce that the result is polymorphic -- in particular I suspect that you are running up against the value restriction. An easy way to check would be to change the definition to: let stream_declarations : 'a. (internal_result,'a) result_stream = ... or let stream_declarations : type a. (internal_result,a) result_stream = ... both of which enforce polymorphism, and so will give an error if your definition is actually monomorphic. If `stream_declarations` does have the monomorphic type `(internal_result, '_a) result_stream` then any attempt to use it as `(internal_result, b) result_stream` would cause `b` to be unified with `'_a` and thus escape it's scope. Regards, Leo