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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id F098D7EE51 for ; Mon, 8 Apr 2013 05:18:01 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=pra; client-ip=173.201.193.239; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=mailfrom; client-ip=173.201.193.239; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@p3plsmtpa09-10.prod.phx3.secureserver.net) identity=helo; client-ip=173.201.193.239; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="postmaster@p3plsmtpa09-10.prod.phx3.secureserver.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsUCAJU2YlGtycHvjmdsb2JhbABRxWYWDgEBAQEHCwsJEymCTRFAPRYYAwIBAgFLDQgBAYgQnCygM5JrA5x3jjI X-IPAS-Result: AsUCAJU2YlGtycHvjmdsb2JhbABRxWYWDgEBAQEHCwsJEymCTRFAPRYYAwIBAgFLDQgBAYgQnCygM5JrA5x3jjI X-IronPort-AV: E=Sophos;i="4.87,427,1363129200"; d="scan'208";a="10112837" Received: from p3plsmtpa09-10.prod.phx3.secureserver.net ([173.201.193.239]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Apr 2013 05:17:59 +0200 Received: from [192.168.0.2] ([173.26.186.224]) by p3plsmtpa09-10.prod.phx3.secureserver.net with id MFHs1l00A4qv3b901FHtGQ; Sun, 07 Apr 2013 20:17:55 -0700 Message-ID: <516236E1.7090102@emu-bark.com> Date: Sun, 07 Apr 2013 23:17:53 -0400 From: William Smith User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Caml-list Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] Declaring a parameterized type in a .mli Hi I'm trying to create a generic ID module so that it is easy to make multiple distinct ID classes. I want to be able to create sets and maps of them so I've made my signature compatible with Set.Make but I'm not making it that far yet. I want to have one class of IDs for NFA states and another for DFA states etc. and I want to reuse the code when I find I need other ID classes. Here's what I've got in my .mli: module IDRoot : sig end module GenericID ( Root : sig end ) : sig type t val compare : t -> t -> int val to_string : t -> string val cons : unit -> t end module Id = GenericID( IDRoot ) I get a syntax error even though I think I am following the reference books online. The error is on the equal sign of the last line: File "broken.mli", line 13, characters 10-11: Error: Syntax error (For each class of IDs I will declare another IDRoot but with a different name.) Is there a better way? This one seems really simple if I could correct the syntax error. Thanks for any help you can offer. Bill Smith