|
@@ -103,12 +103,12 @@ namespace Invercargill {
|
|
|
return new TransformQuery<T, Tout>(this, (owned)transform);
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<Tout> try_select<Tout>(owned AttemptTransformDelegate<T, Tout> transform) {
|
|
|
+ public virtual Attempts<Tout> attempt_select<Tout>(owned AttemptTransformDelegate<T, Tout> transform) {
|
|
|
return select<Attempt<Tout>>(i => new Attempt<Tout>(() => transform(i))).assert_promotion<Attempts>();
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<Tout> try_select_nested<Tout>(owned AttemptTransformDelegate<T, Enumerable<Attempt<Tout>>> transform) {
|
|
|
- return try_select<Enumerable<Attempt<Tout>>>((owned)transform)
|
|
|
+ public virtual Attempts<Tout> attempt_select_nested<Tout>(owned AttemptTransformDelegate<T, Enumerable<Attempt<Tout>>> transform) {
|
|
|
+ return attempt_select<Enumerable<Attempt<Tout>>>((owned)transform)
|
|
|
.as_enumerable()
|
|
|
.select_many<Attempt<Tout>>(a => a.success ? a.result : Invercargill.single<Attempt<Tout>>(new Attempt<Tout>.unsuccessful(a.error)))
|
|
|
.assert_promotion<Attempts>();
|
|
@@ -264,10 +264,8 @@ namespace Invercargill {
|
|
|
return keys.select<Grouping<TKey, T>>(g => new Grouping<TKey, T>(g, this.where(i => key_equality(g, key_selector(i)))));
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<T> @with(T item) {
|
|
|
- var seq = new Series<T>();
|
|
|
- seq.add(item);
|
|
|
- return concat(seq);
|
|
|
+ public virtual Enumerable<T> @with(T item, uint times = 1) {
|
|
|
+ return concat(range(0, (int)times, 1).select<T>(i => item));
|
|
|
}
|
|
|
|
|
|
public virtual T first(owned PredicateDelegate<T>? predicate = null) throws SequenceError {
|
|
@@ -450,8 +448,8 @@ namespace Invercargill {
|
|
|
return series;
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<Tout> try_map_with<Tout>(Mapper<Tout, T> mapper) {
|
|
|
- return try_select<Tout>(o => mapper.materialise(o));
|
|
|
+ public virtual Attempts<Tout> attempt_map_with<Tout>(Mapper<Tout, T> mapper) {
|
|
|
+ return attempt_select<Tout>(o => mapper.materialise(o));
|
|
|
}
|
|
|
|
|
|
public virtual Enumerable<T> as_enumerable() {
|