Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2009-04-15 (21:22)
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  

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.