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.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 2A273BBAF for ; Tue, 2 Sep 2008 10:34:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvUAAFiXvEhKfU4YnGdsb2JhbACSDD4BAQEBAQgDCgcRmU6GEgEC X-IronPort-AV: E=Sophos;i="4.32,315,1217800800"; d="scan'208";a="28714751" Received: from ey-out-2122.google.com ([74.125.78.24]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Sep 2008 10:34:35 +0200 Received: by ey-out-2122.google.com with SMTP id 6so886321eyi.15 for ; Tue, 02 Sep 2008 01:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ZyLCbVZvkE4nKzYyC2ZVrm36xnlVylEISklRwgCT0k4=; b=MMkWtSZe/U553vXk93SwKDMTp9IoAh1UdUGaHXY35dFFk8F5iw/aStGdI4qU2iZdDd OUx/c2quluyFCXf63WIThu8I8AhjRuhRot+R0wF9bD/5OjDmMDuxr+WydGKpFwiPItZv 2kqIUdqQSoeCFNmmKiGWwcARNJqOSdhqhFFRg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ApUch2D5p0Qt55eB4aEZI9KSZ+Vno7WTJ9dPN7NkiN73tkq6oDKXO0hNLu3gQEegmQ tfcS/1QusB2o64lCrWuvWEGYOQPERax2VoK2uvY8830i+bH0GpfaXt60UWmbIN1/+9Fz Y92/m/I/OT9ppt1ZrbrKL0JMx528vRD4BNmgg= Received: by 10.210.25.19 with SMTP id 19mr7914038eby.120.1220344474989; Tue, 02 Sep 2008 01:34:34 -0700 (PDT) Received: by 10.210.61.10 with HTTP; Tue, 2 Sep 2008 01:34:34 -0700 (PDT) Message-ID: <527cf6bc0809020134u783ffcefv83082e009d400814@mail.gmail.com> Date: Tue, 2 Sep 2008 10:34:34 +0200 From: "blue storm" To: david.baelde@ens-lyon.org Subject: Re: [Caml-list] `This expression is not a function it cannot be applied' Cc: "Christian Sternagel" , caml-list@yquem.inria.fr In-Reply-To: <53c655920809020126t41811fb0s7c226e48bdb4eabd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48BCF2BB.3090507@uibk.ac.at> <53c655920809020126t41811fb0s7c226e48bdb4eabd@mail.gmail.com> X-Spam: no; 0.00; parser:01 sig:01 val:01 val:01 storm:98 token:01 token:01 wrote:01 abstract:01 abstract:01 caml-list:01 lazy:02 expression:02 implemented:02 module:03 On Tue, Sep 2, 2008 at 10:26 AM, David Baelde wrote: > This amouns to provide a cast from the abstract type to the function > type, while keeping the liberty on how it's implemented. If you want even more implementation liberty, you should consider making the internal "token collection" type abstract : you use a list for now, but might want to use Streams or lazy lists or what not someday. That would give something like that : module Parser : sig type ('a,'tok) t type 'tok input val token : ('tok -> 'a option) -> ('a,'tok) t val apply : ('a,'tok) t -> 'tok input -> ('a * 'tok input) val input_of_list : 'tok list -> 'tok input end = [...]