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.8 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 8249BBBAF for ; Fri, 25 Jul 2008 14:31:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgAAJ9kiUjOvjGxmmdsb2JhbACSWAEBAQEBCAUIBxEDnXo X-IronPort-AV: E=Sophos;i="4.31,252,1215381600"; d="scan'208";a="15450038" Received: from web54607.mail.re2.yahoo.com ([206.190.49.177]) by mail3-smtp-sop.national.inria.fr with SMTP; 25 Jul 2008 14:31:10 +0200 Received: (qmail 57583 invoked by uid 60001); 25 Jul 2008 12:31:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=57W1RX2WbzPUg/eAchO2LV26xIwQJQZ4a9fOvVpc65WEoTk/uXChzFFnvbgRM0Ob+aT85uNfjAUSKPlCbEUDQN2UEOl1JyfW8LM1Ydd9CRWTrm1IHIgPKIaQwr7RBIecZuJqXD58e9AWNDnukXodJ6nSATxL0xsdgeGZGDS1Isg=; Received: from [212.13.62.175] by web54607.mail.re2.yahoo.com via HTTP; Fri, 25 Jul 2008 05:31:09 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Fri, 25 Jul 2008 05:31:09 -0700 (PDT) From: Dario Teixeira Subject: Sexplib and types defined via constraint To: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <363597.53244.qm@web54607.mail.re2.yahoo.com> X-Spam: no; 0.00; extensively:01 syntax:01 syntax:01 foobar:01 sig:01 foo:01 foobar:01 sexp:01 foo:01 sexp:01 struct:01 rec:01 functions:01 functions:01 constraint:01 Hi, I've been using Sexplib quite extensively. The syntax extension makes addi= ng (de)serialisation functions very simple and convenient, and up till now it has automatically handled every data structure I threw at it. But consider the module fragment below; type t is defined via a constraint, and includes a type parameter ('b) used as a phantom type. The Sexplib syn= tax extension fails to parse the definition of t, producing an error: Failure: "get_tparam_id: not a type parameter" Preprocessing error on file document.ml Is this a known limitation of Sexplib, in which case the (de)serialization functions for t must be built manually? Thanks in advance, Dario Teixeira module rec Foobar: sig type foo_t =3D [ `A of int | `B of Foobar.bar_t ] with sexp type bar_t =3D [ `C of int | `D of Foobar.foo_t ] with sexp type foobar_t =3D [ foo_t | bar_t ] with sexp type (+'a, 'b) t =3D private Foobar of 'a constraint 'a =3D [< foob= ar_t ] with sexp end =3D struct type foo_t =3D [ `A of int | `B of Foobar.bar_t ] with sexp type bar_t =3D [ `C of int | `D of Foobar.foo_t ] with sexp type foobar_t =3D [ foo_t | bar_t ] with sexp type (+'a, 'b) t =3D Foobar of 'a constraint 'a =3D [< foobar_t ] w= ith sexp end =0A=0A=0A __________________________________________________________= =0ANot happy with your email address?.=0AGet the one you really want - mill= ions of new email addresses available now at Yahoo! http://uk.docs.yahoo.co= m/ymail/new.html