[wg-camlp4] My uses of syntax extension

Wojciech Meyer wojciech.meyer at gmail.com
Tue Jan 29 13:23:01 GMT 2013


> For example (a quotation for Haskell's arrow notation):
>
> <:proc < x ->           y <- f -< x + 1;
>           g -< 2 * y;
>           t <- h -< x * (x + y);
>           return -< t + y >>
>
> is definitely preferable to:
>
> <:proc < $x$ ->           y <- $f$ -< $x + 1$;
>           $g$ -< $2 * y$;
>           t <- $h$ -< $x * (x + y)$;
>           $return$ -< $t + y$ >>
>

FWIW: You can generate the second from former, by making a pass over the AST.

-Wojciech


More information about the wg-camlp4 mailing list