Add result_of to algorithms