Traverses the given iterator and stores the emitted values in a {name}HashSet.
If the iterator is not finite, this function might run forever. Given {givenInstance}Finite α m,
the variant {lean}it.ensureTermination.toHashSet always terminates after finitely many steps.
Equations
- it.toHashSet = Std.IterM.fold (fun (acc : Std.HashSet β) (a : β) => acc.insert a) ∅ it
Instances For
Traverses the given iterator and stores the emitted values in a HashSet.
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 IterM.toHashSet.
Instances For
Traverses the given iterator and stores the emitted values in a {name}ExtHashSet.
If the iterator is not finite, this function might run forever. Given {givenInstance}Finite α m,
the variant {lean}it.ensureTermination.toExtHashSet always terminates after finitely many steps.
Equations
- it.toExtHashSet = Std.IterM.fold (fun (acc : Std.ExtHashSet β) (a : β) => acc.insert a) ∅ it
Instances For
Traverses the given iterator and stores the emitted values in a ExtHashSet.
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 IterM.toExtHashSet.
Equations
- it.toExtHashSet = it.it.toExtHashSet
Instances For
Traverses the given iterator and stores the emitted values in a {name}TreeSet.
If the iterator is not finite, this function might run forever. Given {givenInstance}Finite α m,
the variant {lean}it.ensureTermination.toTreeSet always terminates after finitely many steps.
Equations
- it.toTreeSet cmp = Std.IterM.fold (fun (acc : Std.TreeSet β cmp) (a : β) => acc.insert a) ∅ it
Instances For
Traverses the given iterator and stores the emitted values in a TreeSet.
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 IterM.toTreeSet.
Instances For
Traverses the given iterator and stores the emitted values in a {name}ExtTreeSet.
If the iterator is not finite, this function might run forever. Given {givenInstance}Finite α m,
the variant {lean}it.ensureTermination.toExtTreeSet cmp always terminates after finitely
many steps.
Equations
- it.toExtTreeSet cmp = Std.IterM.fold (fun (acc : Std.ExtTreeSet β cmp) (a : β) => acc.insert a) ∅ it
Instances For
Traverses the given iterator and stores the emitted values in a ExtTreeSet.
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 IterM.toExtTreeSet.
Equations
- it.toExtTreeSet cmp = it.it.toExtTreeSet cmp