From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 98A9EBC28 for ; Fri, 12 Nov 2004 17:12:18 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iACGCI2M021724 for ; Fri, 12 Nov 2004 17:12:18 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA31458 for ; Fri, 12 Nov 2004 17:12:17 +0100 (MET) Received: from trdlnk.com (postman.trdlnk.com [208.252.163.7]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iACGCGc6024818 for ; Fri, 12 Nov 2004 17:12:17 +0100 Received: from [10.137.1.97] (maggie [10.137.1.97]) by trdlnk.com (8.12.10+Sun/8.12.10) with ESMTP id iACGCFL1010388 for ; Fri, 12 Nov 2004 10:12:15 -0600 (CST) Message-ID: <4194E0C7.4060102@trdlnk.com> Date: Fri, 12 Nov 2004 10:11:51 -0600 From: josh User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Specifying abstract type in a record References: <20041111083547.GA13116@pulp.anu.edu.au> <1100163369.2579.70.camel@pelican.wigram> <20041111090931.GA13972@pulp.anu.edu.au> <20041111104849.29e7e506@mpiat2314> In-Reply-To: <20041111104849.29e7e506@mpiat2314> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4194E0E2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4194E0E0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; unbound:01 polymorphic:01 abstract:01 abstract:01 expression:01 int:01 int:01 parameter:02 unit:02 unit:02 string:03 string:03 let:03 specify:06 i'm:08 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: OK, Here's what I'm trying to do: # type doer = { file_name:string ; actor: ('a -> unit) };; But when I do this, it tells me that I've got "Unbound type parameter 'a ". However, if I change the 'a to int like this: # type doer = { file_name:string; actor: (int -> unit) };; It works as expected, but is not polymorphic (which is what I was trying to do). If I create an abstract type like: # type t # type doer = { file_name:string; actor (t -> unit) };; It works until I try to use a created record: # let b = {file_name = "one"; actor = (fun x -> () ) };; # b.actor 10;; The expression has type int but is used with type t even if I try to do this # type t = int;; it doesn't work. So, how _can_ I specify a record with an abstract field? Or is this the Wrong Way to Do Things? Thank you for your help. -jbs