Recursion with generators

Ping @bakura10 @arekkas.