caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Andrey Riabushenko <cdome@bk.ru>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Functional unparsing
Date: Wed, 15 Apr 2009 23:21:36 +0200	[thread overview]
Message-ID: <8A16D392-8DE1-4D34-8AE8-C430270B56E5@erratique.ch> (raw)
In-Reply-To: <200904152341.28121.cdome@bk.ru>

Le 15 avr. 09 à 22:41, Andrey Riabushenko a écrit :

> Something like that:
>
> Stats.linear_regression "y ~ x1 exp(x2) log(x3) x3^2"
> Returns float -> float -> float -> float -> regression_result = <fun>

It won't work with control strings as plain strings -- what would the  
type of Stats.linear_regression be ? Functional unparsing solves the  
problem by using values of a particular type and combinators to  
represent the control string (you can actually see it as directly  
manipulating the abstract syntax tree of the corresponding control  
string).

Have a look at Olivier Danvy's paper [1]. You may also be interested  
in language embedding in general, see this message [2] for a reference  
and an example.

Best,

Daniel


[1] http://www.brics.dk/RS/98/12/BRICS-RS-98-12.pdf
[2] http://caml.inria.fr/pub/ml-archives/caml-list/2008/03/8bc5f07678134c77037c1a2feedd4d90.en.html

  reply	other threads:[~2009-04-15 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 20:41 Andrey Riabushenko
2009-04-15 21:21 ` Daniel Bünzli [this message]
2009-04-15 21:40 ` [Caml-list] " Hezekiah M. Carty
2009-04-17  8:36   ` Andrey Riabushenko
2009-04-16  9:25 ` Cedric Auger

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=8A16D392-8DE1-4D34-8AE8-C430270B56E5@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@yquem.inria.fr \
    --cc=cdome@bk.ru \
    /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;
as well as URLs for NNTP newsgroup(s).