first example of a transducer in action

implementation in C necessitates a lot of allocations for all the closures,
probably cannot be inlined. I also did not bother deallocating closures
and this is an interesting problem in itself.