caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Deepest Lexically Faithful OCaml Syntax Folds
@ 2013-06-02 17:19 David Sheets
  2013-06-03 20:42 ` [Caml-list] " David Sheets
  0 siblings, 1 reply; 2+ messages in thread
From: David Sheets @ 2013-06-02 17:19 UTC (permalink / raw)
  To: caml-list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-03 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-02 17:19 [Caml-list] Deepest Lexically Faithful OCaml Syntax Folds David Sheets
2013-06-03 20:42 ` [Caml-list] " David Sheets

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).