From: Christian Sternagel <christian.sternagel@uibk.ac.at>
To: caml-list@yquem.inria.fr
Subject: `This expression is not a function it cannot be applied'
Date: Tue, 02 Sep 2008 10:00:59 +0200 [thread overview]
Message-ID: <48BCF2BB.3090507@uibk.ac.at> (raw)
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
next reply other threads:[~2008-09-02 8:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 8:00 Christian Sternagel [this message]
2008-09-02 8:26 ` [Caml-list] " David Baelde
2008-09-02 8:34 ` blue storm
2008-09-02 8:46 ` David Teller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48BCF2BB.3090507@uibk.ac.at \
--to=christian.sternagel@uibk.ac.at \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox