From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q479ef16030964 for ; Mon, 7 May 2012 11:40:41 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8GABOYp09iiyyDZmdsb2JhbABEgkawUQ0IDAcWJ4IDCQEBBEEBAQEBNgEDGQGJMQEDBgWnFYQxAQWEIgJIBYlUAQaNeYMmiGiEWIhJhW8tjSg X-IronPort-AV: E=Sophos;i="4.75,543,1330902000"; d="scan'208,217";a="157024808" Received: from nm4.access.bullet.mail.sp2.yahoo.com ([98.139.44.131]) by mail1-smtp-roc.national.inria.fr with SMTP; 07 May 2012 11:40:35 +0200 Received: from [98.139.44.102] by nm4.access.bullet.mail.sp2.yahoo.com with NNFMP; 07 May 2012 09:40:34 -0000 Received: from [98.139.44.76] by tm7.access.bullet.mail.sp2.yahoo.com with NNFMP; 07 May 2012 09:40:34 -0000 Received: from [127.0.0.1] by omp1013.access.mail.sp2.yahoo.com with NNFMP; 07 May 2012 09:40:34 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 82590.5715.bm@omp1013.access.mail.sp2.yahoo.com Received: (qmail 10084 invoked by uid 60001); 7 May 2012 09:40:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1336383633; bh=4SqOrZ6IMSiBtCv/7csutHlMh+KgpPWsoDHcM5HDE4Q=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=CZ2f32wTUMljIaMwQL5x4m5KXg6xtmlLL3J6chl8d3hlBvq3AT42/Mj9rmn/KnK9x79Fd0BHeIWIQjFqCgSE46jtuoLLIjNRUa3iPTAXPwpfJ+jzdoKpYV1C8ncbFe88LKzZ0yIZZqPtW12S6e50igx5WgKmHPxptfAFOoDY7GM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=att.net; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=kvB7rgoYzQDZy7lQLY9Vh4FychKmv9RNPrNHlv9pIrrsqdM8j9XFgoXoInK0gS7jI3ZTddCS+NY+jHPlH5uUHRyzX9hgkrLbtOFbPb+ob8N4nAb8QN2o9GFbffcUBVHTUG84QqzFuBsvAI8tMxWoTy7D/P/0coYoxl3+bSHL5P0=; X-YMail-OSG: DcrGwtYVM1nE5.4g5moNv9rBmH79NCxvRTviL_SFnAZUS9P H8kVCkhGINGUrbF.2Sr7lvPJOAwwnb43Lbd66ulTBNYMBzRV7WQc6EAR8mBZ aW.qaK2J7Jg5r03ltKNMembzPz6zl531H6AZT2WP32q8SVK5kEpkfKSbIT9E O4bX.6vFOa3_NLhsbwplWr0j2ZMwv0zx6mb_tjZunZZiQ6qRbpnzC4ZxdsNU 0kTcxL7OlEHN67mO1GtU_nF9rZM3aAmFV3cxVLqJNs1nzi_7V.lFLnmJFBNQ rDrHT5nzsqFkO6jL07hYRnlsQRT9R5emawHMDwhGm.GF.Qi27rRZMhQjAl.s 4o8EIqSh22pbjxU2xEZUdPt6T6h.LOM2Hiye0AqPgLyoPHoLa7wjNnyQthNT JlDAkFcd.R3acrbvnaMHOytLFd0Zdz52862P1aGbf3Qjt Received: from [70.225.163.92] by web180006.mail.gq1.yahoo.com via HTTP; Mon, 07 May 2012 02:40:33 PDT X-Mailer: YahooMailRC/708 YahooMailWebService/0.8.117.340979 Message-ID: <1336383633.2612.YahooMailRC@web180006.mail.gq1.yahoo.com> Date: Mon, 7 May 2012 02:40:33 -0700 (PDT) From: Dan Bensen To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-729476438-711498962-1336383633=:2612" Subject: [Caml-list] extending user-defined polymorphic variant types ---729476438-711498962-1336383633=:2612 Content-Type: text/plain; charset=us-ascii I'm trying to write a functor that extends a user-supplied polymorphic variant type (PVT). How do you declare the user's type in the signature for the argument to the functor without locking in the individual variant definitions? The code below (in revised syntax) generates an error message that says the type isn't a PVT. code: > module type Reader = sig type ast; end; > > module Make (Read: Reader) = struct > type ast = [= Read.ast | `Lid of string]; > end; message: > Error: The type Read.ast is not a polymorphic variant type How do you make ast a PVT while allowing the user to specify the variants? ---729476438-711498962-1336383633=:2612 Content-Type: text/html; charset=us-ascii

I'm trying to write a functor that extends a user-supplied polymorphic
variant type (PVT).  How do you declare the user's type in the signature
for the argument to the functor without locking in the individual variant
definitions? 
The code below (in revised syntax) generates an error message that says
the type isn't a PVT.

code:

> module type Reader = sig type ast; end;
>
> module Make (Read: Reader) = struct
>   type ast = [= Read.ast | `Lid of string];
> end;

message:

> Error: The type Read.ast is not a polymorphic variant type

How do you make ast a PVT while allowing the user to
specify the variants?
---729476438-711498962-1336383633=:2612--