Version française
Home     About     Download     Resources     Contact us    
Browse thread
Functional unparsing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Functional unparsing
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