From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E9344BBAF for ; Wed, 11 Mar 2009 07:11:18 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlwCANPytknB/BdAk2dsb2JhbACVLgEBAQEJCQoJEQO8IYQNBg X-IronPort-AV: E=Sophos;i="4.38,340,1233529200"; d="scan'208";a="22361745" Received: from smtp1b.orange.fr ([193.252.23.64]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Mar 2009 07:11:18 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1b03.orange.fr (SMTP Server) with ESMTP id 1268D7000089; Wed, 11 Mar 2009 07:11:18 +0100 (CET) Received: from wwinf1b03 (wwinf1b03 [10.232.19.30]) by mwinf1b03.orange.fr (SMTP Server) with ESMTP id 0A69E7000085; Wed, 11 Mar 2009 07:11:18 +0100 (CET) X-ME-UUID: 20090311061118427.0A69E7000085@mwinf1b03.orange.fr From: yoann padioleau Reply-To: yoann padioleau To: Markus Mottl Cc: Caml-list List Message-ID: <21952156.346634.1236751878001.JavaMail.www@wwinf1b03> In-Reply-To: References: <87prgoydy1.fsf@aryx.cs.uiuc.edu> Subject: Re: [Caml-list] typing problem with sexplib and mutually recursive polymorphic types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [98.212.173.155] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| Date: Wed, 11 Mar 2009 07:11:18 +0100 (CET) X-Spam: no; 0.00; recursive:01 recursive:01 foo:01 foo:01 checker:01 cheers:01 markus:01 markus:01 mottl:01 ocaml:01 mottl:01 polymorphic:01 closures:01 rec:01 rec:01 > > This has to do with recursive type definitions, not with generating > closures with _loc. The following is similar and does not compile > either: > > let rec foo () = [] > and bar () = "asdf" :: foo () > and bla () = 42 :: foo () > > These definitions are clearly sound, but the type checker doesn't get > it. Note, however, that the following works: > > let foo () = [] > let rec bar () = "asdf" :: foo () > and bla () = 42 :: foo () > > You can apply the same trick in your specific example by simply moving > the type definition of x1 out of the cycle with x2 and x3. Yes on this example, but what if I can't move it out because the types really need to be mutually recursive ? > > Cheers, > Markus > > -- > Markus Mottl http://www.ocaml.info markus.mottl@gmail.com > >