> @dotta, I don't think this is working.
> If I remember unwrapping for comprehension correctly, it would be equivalent to:
```scala
occurences.iterator.filter(!monitor.isCanceled).map{ ... }
```
s/filter/withFilter

(in the specific case of an interator, ``withFilter`` and ``filter`` share the same implementation. However, they are definitely not equivalent in general, [here is a discussion on the topic](http://scala-programming-language.1934581.n4.nabble.com/Rethinking-filter-td2009215.html#a2009218), if interested)

> So the check for the monitor state would be done a few times in a row, but not during the actual computation.

Not quite: https://github.com/scala/scala/blob/v2.10.2/src/library/scala/collection/Iterator.scala#L382

> I think the first version was better. (also, the `.iterator` is not needed)

I disagree. And the call to ``.iterator`` is still needed.