|
@@ -166,6 +166,17 @@ namespace Invercargill {
|
|
|
.assert_promotion<Attempts>();
|
|
|
}
|
|
|
|
|
|
+ public virtual Attempts<T> attempt_where(owned AttemptPredicate<T> predicate) {
|
|
|
+ return select_where<Attempt<T>>((i, ref o) => {
|
|
|
+ bool match = true;
|
|
|
+ o = new Attempt<T>(() => {
|
|
|
+ match = predicate(i);
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+ return match;
|
|
|
+ }).assert_promotion<Attempts>();
|
|
|
+ }
|
|
|
+
|
|
|
public virtual Enumerable<Pair<TFirst, TSecond>> select_pairs<TFirst, TSecond>(owned TransformDelegate<T, TFirst> transform1, owned TransformDelegate<T, TSecond> transform2) {
|
|
|
return select<Pair<TFirst, TSecond>>(i => new Pair<TFirst, TSecond>(transform1(i), true, transform2(i), true));
|
|
|
}
|