add functions each and fromGenerator, update some examples