with_progress function

Reporting progress (functional API)