heptagon/test/async/pipline.ept
Léonard Gérard b913edcd5e Decade alpha1
On the road to beta is the new Minils AST, for now :

* Heptagon and Obc AST changes,
* Java code generation,
* Recursives Qualnames,
* Various bug fixes,

* Added partial application for iterators,
For instance:
  ... = map<<n>> (f<<se>>)((t1, t1'))(t2, t3)
is translated to:
  for(int i =...)
    ... = f(t1, t1', t2[i], t3[i])
2011-03-21 22:24:36 +01:00

25 lines
384 B
Text

fun sum (x,m: int) returns (s: int)
let
s = x + m
tel
fun substr (x,m: int) returns (d: int; m2:int)
let
d = x - m;
m2 = m;
tel
fun mean<<n: int>> (i: int^n) returns (m: int)
let
m = (fold (+) <<n>> (i,0)) /n
tel
node normalized_movie<<n: int>> (i: int^n) returns (im: int^n)
var m: int; trash: int;
let
m = mean<<n>>(i);
(im,trash) = mapfold substr <<n>> (i,m)
tel