void->int filter Generate{ int x=0; //Note that native filters can have state. work push 1{ push(x); x = x+1; } } int->void filter Read{ work pop 1{ print( pop() ); } } bit->bit filter BoolFilter{ work push 2 pop 4{ push( ( (peek(1) & peek(2) ) ^ (peek(0) | peek(3)) ) ); push( ( (peek(2) | peek(3)) & (1^(peek(2) & peek(1))) ) ); // note that 1 ^ x is equivalent to ! x for(int i=0; i<4; ++i) pop(); } } void->void pipeline BoolFilterPL{ add Generate(); add BoolFilter(); add Read(); }