From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B7CD3BBAF for ; Tue, 2 Sep 2008 10:02:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvEAANePvEiK6AGOmmdsb2JhbACSSgEBAQEBCAUIBxEFn1GBaQ X-IronPort-AV: E=Sophos;i="4.32,315,1217800800"; d="scan'208";a="14475671" Received: from lmr1.uibk.ac.at (HELO smtp.uibk.ac.at) ([138.232.1.142]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Sep 2008 10:02:45 +0200 Received: from [138.232.66.221] (pc6221-c703.uibk.ac.at [138.232.66.221] christian.sternagel@uibk.ac.at) (authenticated bits=0) by smtp.uibk.ac.at (8.13.8/8.13.8/F1) with ESMTP id m8282d9x030021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Sep 2008 10:02:40 +0200 Message-ID: <48BCF2BB.3090507@uibk.ac.at> Date: Tue, 02 Sep 2008 10:00:59 +0200 From: Christian Sternagel User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: `This expression is not a function it cannot be applied' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.61 at uibk.ac.at on 138.232.1.140 X-Spam: no; 0.00; parser:01 sig:01 val:01 struct:01 parser:01 cheers:01 token:01 token:01 abstract:01 ident:01 data:02 expression:02 functional:02 module:03 module:03 Is there a way to be able to apply something of an abstract data type without knowing the internal representation? E.g., when having the module module Parser : sig type ('a,'tok) t val token : ('tok -> 'a option) -> ('a,'tok) t end = struct type ('a,'tok) t = 'tok list -> ('a * 'tok list) let token ... = ... end I want to be able to apply the result of (token (function Ident s -> Some s | None)) to some further input (since it is a parser), however, this is not possible since the result type is not functional. The only way out I see is to `unabstract' the type and give its internal representation. Or is there another possibility? cheers christian