From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 0CBA37EE11 for ; Wed, 20 Aug 2014 14:59:49 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=pra; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=mailfrom; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.tu-berlin.de) identity=helo; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="postmaster@mail.tu-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0BAJ+b9FOClQchm2dsb2JhbABZhDe2S55sFhABAQEBAQgJCwkUKYQxCwGBAjQCTA0GAgEBiD6dNqUDF45khTsFkiCRTI9HHIFeaoJPAQEB X-IPAS-Result: Al0BAJ+b9FOClQchm2dsb2JhbABZhDe2S55sFhABAQEBAQgJCwkUKYQxCwGBAjQCTA0GAgEBiD6dNqUDF45khTsFkiCRTI9HHIFeaoJPAQEB X-IronPort-AV: E=Sophos;i="5.01,902,1400018400"; d="scan'208";a="90022946" Received: from mail.tu-berlin.de ([130.149.7.33]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Aug 2014 14:59:28 +0200 X-tubIT-Incoming-IP: 130.149.172.228 Received: from brego.uebb.tu-berlin.de ([130.149.172.228]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtpa for id 1XK5U6-0008FL-2S; Wed, 20 Aug 2014 14:59:27 +0200 Message-ID: <53F49BAE.40901@tu-berlin.de> Date: Wed, 20 Aug 2014 14:59:26 +0200 From: =?ISO-8859-15?Q?Christoph_H=F6ger?= Organization: Technische =?ISO-8859-15?Q?Universit=E4t_Berlin?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: caml users Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Subject: [Caml-list] recursive values of abstract types, aka Batteries ParserCo -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I wanted to parse a small lambda-calculus in OCaml and had batteries already as a dependency. Batteries comes with ParserCo, a small parser combinator library. Since I did not want to complicate things further, I decided to stick with it and avoid any parser generator. Using a monadic combinator library for a scannerless parser should be a relatively simple exercise, right? Unfortunately, it seems that ParserCo only exposes an abstract type: type ('a, 'b, 'c) t which is, of course, a function: type ('a, 'b, 'c) t = ('a, 'c) Source.t -> ('a, 'b, 'c) result This prevents me from defining any recursive parsers, since OCaml won't let me let-rec a value of an abstract function type. I cannot do eta-expansion, because the type is abstract, and I also do not have a type constructor at hand. How does one handle such cases in OCaml? Does this really mean, you cannot have recursive values of abstract function types? thanks, Christoph - -- Christoph Höger Technische Universität Berlin Fakultät IV - Elektrotechnik und Informatik Übersetzerbau und Programmiersprachen Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin Tel.: +49 (30) 314-24890 E-Mail: christoph.hoeger@tu-berlin.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlP0m64ACgkQhMBO4cVSGS+FcACdF2eqj5eN80oeRTghSnKDd9E+ 80MAoL1DpqKfx5+UxJoLnUyZwpXQCibH =Rw4X -----END PGP SIGNATURE-----