Collectors #
This module provides consumers that collect the values emitted by an iterator in a data structure. Concretely, the following operations are provided:
Iter.toList, collecting the values in a listIter.toListRev, collecting the values in a list in reverse order but more efficientlyIter.toArray, collecting the values in an array
Some operations are implemented using the IteratorCollect type class.
Traverses the given iterator and stores the emitted values in an array.
If the iterator is not finite, this function might run forever. The variant
it.ensureTermination.toArray always terminates after finitely many steps.
Instances For
Traverses the given iterator and stores the emitted values in an array.
This function is deprecated. Instead of it.allowNontermination.toArray, use it.toArray.
Instances For
Traverses the given iterator and stores the emitted values in an array.
This variant terminates after finitely many steps and requires a proof that the iterator is
finite. If such a proof is not available, consider using Iter.toArray.
Instances For
Traverses the given iterator and stores the emitted values in reverse order in a list. Because
lists are prepend-only, this toListRev is usually more efficient that toList.
If the iterator is not finite, this function might run forever. The variant
it.ensureTermination.toListRev always terminates after finitely many steps.
Instances For
Traverses the given iterator and stores the emitted values in reverse order in a list. Because
lists are prepend-only, this toListRev is usually more efficient that toList.
This function is deprecated. Instead of it.allowNontermination.toListRev, use it.toListRev.
Instances For
Traverses the given iterator and stores the emitted values in reverse order in a list. Because
lists are prepend-only, this toListRev is usually more efficient that toList.
This variant terminates after finitely many steps and requires a proof that the iterator is
finite. If such a proof is not available, consider using Iter.toListRev.
Instances For
Traverses the given iterator and stores the emitted values in a list. Because
lists are prepend-only, toListRev is usually more efficient that toList.
If the iterator is not finite, this function might run forever. The variant
it.ensureTermination.toList always terminates after finitely many steps.
Instances For
Traverses the given iterator and stores the emitted values in a list. Because
lists are prepend-only, toListRev is usually more efficient that toList.
This function is deprecated. Instead of it.allowNontermination.toList, use it.toList.
Instances For
Traverses the given iterator and stores the emitted values in a list. Because
lists are prepend-only, toListRev is usually more efficient that toList.
This variant terminates after finitely many steps and requires a proof that the iterator is
finite. If such a proof is not available, consider using Iter.toList.