From: David Sheets <sheets@alum.mit.edu>
To: caml-list@inria.fr
Subject: [Caml-list] Deepest Lexically Faithful OCaml Syntax Folds
Date: Sun, 2 Jun 2013 18:19:24 +0100 [thread overview]
Message-ID: <CAAWM5Tzrg-JBNqCf8T2sa=idDu7rDfy0zUuJsK9GZDX3Q6V-iw@mail.gmail.com> (raw)
Hello World,
I am searching for the "deepest lexically faithful OCaml syntax
catamorphism solution" as the title indicates. What precisely do I
mean by this?
Deepest => most semantically abstract while retaining a map back to syntax
Lexically faithful => injective, accurate, coordinate-tracked tokens
OCaml syntax => a fine conjuring form
Catamorphism => the source annotations occur as reserialization folds
of some kind
Solution => relatively cheap to integrate
Specifically, I am looking for a collection of functions like:
ana ocaml_parse : string -> '_a
cata : '_a -> (('_a -> '_b) * ('_b list -> '_b)) -> '_b
cata' : '_b -> (('_b -> '_c) * ('_c list -> '_c)) -> '_c
.
.
.
serialize : '_c -> ('_c -> string) -> string
where ana's domain is OCaml source code and cata''s range is (possibly
annotated) OCaml source (which may not be valid for reconsumption
without further processing). The multiplication operator's signature
may vary.
such that the weakly polymorphic types above can be mapped over by
adding arbitrary annotations. Any number of catamorphic levels is
acceptable. OCaml 3.12 and 4.x syntax support necessary.
Is the answer some invocation of camlp4, ppx, fan, or compiler
internals? Am I asking for something nonsensical? Have you already
implemented something similar? Do functions equivalent to these exist
in a tool of which you know?
Thank you,
David
next reply other threads:[~2013-06-03 11:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-02 17:19 David Sheets [this message]
2013-06-03 20:42 ` [Caml-list] " David Sheets
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='CAAWM5Tzrg-JBNqCf8T2sa=idDu7rDfy0zUuJsK9GZDX3Q6V-iw@mail.gmail.com' \
--to=sheets@alum.mit.edu \
--cc=caml-list@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