From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA21761; Wed, 21 Nov 2001 18:46:35 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA18840 for ; Wed, 21 Nov 2001 18:46:34 +0100 (MET) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id fALHkXf16801 for ; Wed, 21 Nov 2001 18:46:33 +0100 (MET) Received: from localhost (patrick@localhost) by fledge.watson.org (8.11.6/8.11.5) with ESMTP id fALHkLr11658 for ; Wed, 21 Nov 2001 12:46:22 -0500 (EST) (envelope-from patrick@watson.org) Date: Wed, 21 Nov 2001 12:46:20 -0500 (EST) From: Patrick M Doane To: caml-list@inria.fr Subject: [Caml-list] New polymorphic variant syntax Message-ID: <20011121122117.A10520-100000@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, On the Bedouin project, we are currently exploring ways to verify that construction of HTML data will respect constraints specified in a DTD. We recently tried using the new polymorphic variant syntax in the 3.03 alpha version to represent entity references. For example: type fontstyle = [ `Tt | `I | `B | `U | `S | `Strike | `Big | `Small ] type inline = [ `Pcdata | fontstyle | ... ] type flow = [ block | inline ] Then HTML generating functions use a phantom type to track the DTD constraints: val tt_ : ?id:string -> ?class_:string -> (* ... more attributes follow ... *) [< inline ] t list -> [> `Tt] t Having abbreviations like 'inline' works really well. I'm curious to know if there is a good way to represent the following information: This states that a FORM element can have any flow object except for FORM (i.e. nesting is not allowed). How difficult would it be to extend the polymorphic variant syntax to list tags that should not be included in the conjuction? Perhaps this already possible? Of course we can always revert to simply listing the variants. Thanks for the good work! This is much nicer to work with compared with 3.02. Patrick ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr