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=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 0FF15BBAF for ; Tue, 2 Sep 2008 10:46:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As4EAOyZvEjCpx6vamdsb2JhbACSSg0FCAYSn3KBaQ X-IronPort-AV: E=Sophos;i="4.32,315,1217800800"; d="scan'208";a="16486445" Received: from smtpka.univ-orleans.fr (HELO ka.univ-orleans.fr) ([194.167.30.175]) by mail3-smtp-sop.national.inria.fr with ESMTP; 02 Sep 2008 10:46:03 +0200 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id F1CCF12AD49; Tue, 2 Sep 2008 10:46:03 +0200 (CEST) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 7611336E60; Tue, 2 Sep 2008 10:46:04 +0200 (CEST) Subject: Re: [Caml-list] `This expression is not a function it cannot be applied' From: David Teller To: blue storm Cc: david.baelde@ens-lyon.org, caml-list@yquem.inria.fr In-Reply-To: <527cf6bc0809020134u783ffcefv83082e009d400814@mail.gmail.com> References: <48BCF2BB.3090507@uibk.ac.at> <53c655920809020126t41811fb0s7c226e48bdb4eabd@mail.gmail.com> <527cf6bc0809020134u783ffcefv83082e009d400814@mail.gmail.com> Content-Type: text/plain Date: Tue, 02 Sep 2008 10:46:13 +0200 Message-Id: <1220345173.6406.4.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; univ-orleans:01 abstraction:01 parser:01 combinator:01 cheers:01 0200,:01 parser:01 sig:01 val:01 val:01 beginner's:01 ocaml:01 bug:01 univ-orleans:01 lifo:01 Or you can use ExtLib's enumerations for the purpose of abstraction. That's what I'm doing in my parser combinator library. Cheers, David On Tue, 2008-09-02 at 10:34 +0200, blue storm wrote: > 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 = [...] > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.