From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 043C5BB83 for ; Tue, 2 May 2006 19:48:45 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k42Hmi9B016063 for ; Tue, 2 May 2006 19:48:44 +0200 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 TAA07146 for ; Tue, 2 May 2006 19:48:43 +0200 (MET DST) Received: from fmsmga101.fm.intel.com (mga05.intel.com [192.55.52.89]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k42HmgcJ011930 for ; Tue, 2 May 2006 19:48:43 +0200 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 02 May 2006 10:48:41 -0700 Received: from orsmsx331.jf.intel.com (HELO orsmsx331.amr.corp.intel.com) ([192.168.65.56]) by fmsmga001.fm.intel.com with ESMTP; 02 May 2006 10:48:41 -0700 X-IronPort-AV: i="4.05,80,1146466800"; d="scan'208"; a="31374875:sNHT78293173" Received: from orsmsx409.amr.corp.intel.com ([192.168.65.58]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 2 May 2006 10:48:41 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Printing of polymorphic values in #trace Date: Tue, 2 May 2006 10:48:38 -0700 Message-ID: <196F1D996F92CD46A542EA519DB8CE4703A2DD07@orsmsx409> Thread-Topic: Printing of polymorphic values in #trace thread-index: AcZuEKRoD1t4lDX3T4ynABVV0xdqig== From: "Harrison, John R" To: "Caml list" Cc: "Harrison, John R" X-OriginalArrivalTime: 02 May 2006 17:48:41.0078 (UTC) FILETIME=[A6090960:01C66E10] X-Miltered: at concorde with ID 44579B7C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44579B7A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; johnh:01 moderately:01 ocaml:01 ocaml:01 val:01 val:01 polymorphic:01 polymorphic:01 functions:01 tracing:01 explicitly:01 int:01 int:01 caml:02 poly:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 I wanted to suggest a little change to tracing. I can imagine that this might be hard, depending on what type information is available at certain times. But if it's moderately easy I think it would be worth the effort. When displaying the input and output values for a function, OCaml seems to use the most general types, and therefore polymorphic functions often fail to print anything useful. For example: $ ocaml Objective Caml version 3.08.2 # let identity x =3D x;; val identity : 'a -> 'a =3D # #trace identity;; identity is now traced. # identity 1;; identity <-- identity --> - : int =3D 1 If on the other hand I explicitly constrain the type of "identity", I get the effect I want: # let identity (x:int) =3D x;; val identity : int -> int =3D # #trace identity;; identity is now traced. # identity 1;; identity <-- 1 identity --> 1 - : int =3D 1 It would be nice if OCaml did this automatically, since the type of the instance actually used is the same in each case. John.