map each row to an instance of the target type