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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 53C30BB9A for ; Tue, 15 Nov 2005 12:44:40 +0100 (CET) Received: from mx6.mail.ru (mx6.mail.ru [194.67.23.26]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAFBidRV023087 for ; Tue, 15 Nov 2005 12:44:39 +0100 Received: from [212.188.56.210] (port=63003 helo=seva) by mx6.mail.ru with smtp id 1EbzEs-000PLf-00 for caml-list@yquem.inria.fr; Tue, 15 Nov 2005 14:44:38 +0300 Message-ID: <00a701c5e9da$1b0ebc20$670aa8c0@seva> From: "Vsevolod Fedorov" To: Subject: function specialization Date: Tue, 15 Nov 2005 14:45:40 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Miltered: at nez-perce with ID 4379CA27.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 workarounds:01 expression:01 int:01 int:01 exists:01 string:02 string:02 unit:03 unit:03 arg:03 arg:03 let:03 let:03 problem:05 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 Hello! I have code like following: ---- type 'a wrap = ('a -> unit) -> 'a -> unit let wrap fn arg = fn arg let fn1 (v: int) = () let fn2 (v: string) = () let use (wrap: 'a wrap) = wrap fn1 1; wrap fn2 "" (* ^^^ This expression has type string -> unit but is here used with type int -> unit *) ------ and get this error from compiler. Is there any way to use 'wrap' function for both cases: fn1 and fn2? Or is there some 'standard' workarounds/solutions for this problem exists? Thanks Seva