|
@@ -139,29 +139,29 @@ namespace Invercargill {
|
|
|
return new Until<T>(this, (owned)predicate);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> select_where<Tout>(owned FilterTransformDelegate<T, Tout> transform) {
|
|
|
- return new FilterTransform<T, Tout>(this, (owned)transform);
|
|
|
+ public virtual Enumerable<TOut> select_where<TOut>(owned FilterTransformDelegate<T, TOut> transform) {
|
|
|
+ return new FilterTransform<T, TOut>(this, (owned)transform);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> select<Tout>(owned TransformDelegate<T, Tout> transform) {
|
|
|
- return new Transform<T, Tout>(this, (owned)transform);
|
|
|
+ public virtual Enumerable<TOut> select<TOut>(owned TransformDelegate<T, TOut> transform) {
|
|
|
+ return new Transform<T, TOut>(this, (owned)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> attempt_select<TOut>(owned AttemptTransformDelegate<T, TOut> transform) {
|
|
|
+ return select<Attempt<TOut>>(i => new Attempt<TOut>(() => transform(i))).assert_promotion<Attempts>();
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<SelectionContext<T, Tout>> attempt_contextualised_select<Tout>(owned AttemptTransformDelegate<T, Tout> transform) {
|
|
|
- return attempt_select<SelectionContext<T, Tout>>((i) => new SelectionContext<T, Tout>() {
|
|
|
+ public virtual Attempts<SelectionContext<T, TOut>> attempt_contextualised_select<TOut>(owned AttemptTransformDelegate<T, TOut> transform) {
|
|
|
+ return attempt_select<SelectionContext<T, TOut>>((i) => new SelectionContext<T, TOut>() {
|
|
|
origin = i,
|
|
|
result = transform(i)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<Tout> attempt_select_nested<Tout>(owned AttemptTransformDelegate<T, Enumerable<Attempt<Tout>>> transform) {
|
|
|
- return attempt_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)))
|
|
|
+ .select_many<Attempt<TOut>>(a => a.success ? a.result : Invercargill.single<Attempt<TOut>>(new Attempt<TOut>.unsuccessful(a.error)))
|
|
|
.assert_promotion<Attempts>();
|
|
|
}
|
|
|
|
|
@@ -169,8 +169,8 @@ namespace Invercargill {
|
|
|
return select<Pair<TFirst, TSecond>>(i => new Pair<TFirst, TSecond>(transform1(i), true, transform2(i), true));
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> select_many<Tout>(owned TransformDelegate<T, Enumerable<Tout>> transform) {
|
|
|
- return new MergeQuery<Tout>(select((owned)transform));
|
|
|
+ public virtual Enumerable<TOut> select_many<TOut>(owned TransformDelegate<T, Enumerable<TOut>> transform) {
|
|
|
+ return new MergeQuery<TOut>(select((owned)transform));
|
|
|
}
|
|
|
|
|
|
public virtual Enumerable<T> sort(owned CompareDelegate<T> compare) {
|
|
@@ -204,16 +204,16 @@ namespace Invercargill {
|
|
|
return new Skip<T>(this, count);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> cast<Tout>() {
|
|
|
- return select<Tout>(i => (Tout)i);
|
|
|
+ public virtual Enumerable<TOut> cast<TOut>() {
|
|
|
+ return select<TOut>(i => (TOut)i);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> parallel_select<Tout>(owned TransformDelegate<T, Tout> transform, uint workers = 0) {
|
|
|
+ public virtual Enumerable<TOut> parallel_select<TOut>(owned TransformDelegate<T, TOut> transform, uint workers = 0) {
|
|
|
var actual_workers = workers;
|
|
|
if(actual_workers < 1) {
|
|
|
actual_workers = get_num_processors();
|
|
|
}
|
|
|
- return new Parallel<T, Tout>(this, (owned)transform, (int)actual_workers);
|
|
|
+ return new Parallel<T, TOut>(this, (owned)transform, (int)actual_workers);
|
|
|
}
|
|
|
|
|
|
public virtual void parallel_iterate(ItemDelegate<T> handler, uint workers = 0) {
|
|
@@ -224,14 +224,14 @@ namespace Invercargill {
|
|
|
.iterate();
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<SelectionContext<T, Tout>> contextualised_select<Tout>(owned TransformDelegate<T, Tout> transform) {
|
|
|
- return select<SelectionContext<T, Tout>>((i) => new SelectionContext<T, Tout>() {
|
|
|
+ public virtual Enumerable<SelectionContext<T, TOut>> contextualised_select<TOut>(owned TransformDelegate<T, TOut> transform) {
|
|
|
+ return select<SelectionContext<T, TOut>>((i) => new SelectionContext<T, TOut>() {
|
|
|
origin = i,
|
|
|
result = transform(i)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public virtual Tout aggregate<Tout>(Tout initial, AggregateDelegate<Tout, T> aggregate_func) {
|
|
|
+ public virtual TOut aggregate<TOut>(TOut initial, AggregateDelegate<TOut, T> aggregate_func) {
|
|
|
var aggregate = initial;
|
|
|
iterate(i => {
|
|
|
aggregate = aggregate_func(aggregate, i);
|
|
@@ -290,21 +290,21 @@ namespace Invercargill {
|
|
|
return new Zip<T, TOther, TOut>(this, other, (owned)transform);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Pair<T, Tother>> pair_up<Tother>(Enumerable<Tother> other) {
|
|
|
- return zip<Tother, Pair<T, Tother>>(other, (t1v, t1vs, t2v, t2vs) => new Pair<T, Tother>(t1v, t1vs, t2v, t2vs));
|
|
|
+ public virtual Enumerable<Pair<T, TOther>> pair_up<TOther>(Enumerable<TOther> other) {
|
|
|
+ return zip<TOther, Pair<T, TOther>>(other, (t1v, t1vs, t2v, t2vs) => new Pair<T, TOther>(t1v, t1vs, t2v, t2vs));
|
|
|
}
|
|
|
|
|
|
public virtual Enumerable<T> interleave(Enumerable<T> other) {
|
|
|
return new Interleave<T>(this, other);
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> fork<Tout>(owned TransformDelegate<T, Tout> fork1, owned TransformDelegate<T, Tout> fork2) {
|
|
|
+ public virtual Enumerable<TOut> fork<TOut>(owned TransformDelegate<T, TOut> fork1, owned TransformDelegate<T, TOut> fork2) {
|
|
|
var seq = to_series();
|
|
|
- return seq.select<Tout>((owned)fork1).interleave(seq.select<Tout>((owned)fork2));
|
|
|
+ return seq.select<TOut>((owned)fork1).interleave(seq.select<TOut>((owned)fork2));
|
|
|
}
|
|
|
|
|
|
- public virtual Enumerable<Tout> fork_many<Tout>(owned TransformDelegate<T, Enumerable<Tout>> fork1, owned TransformDelegate<T, Enumerable<Tout>> fork2) {
|
|
|
- return new MergeQuery<Tout>(fork((owned)fork1, (owned)fork2));
|
|
|
+ public virtual Enumerable<TOut> fork_many<TOut>(owned TransformDelegate<T, Enumerable<TOut>> fork1, owned TransformDelegate<T, Enumerable<TOut>> fork2) {
|
|
|
+ return new MergeQuery<TOut>(fork((owned)fork1, (owned)fork2));
|
|
|
}
|
|
|
|
|
|
public virtual bool matches(Enumerable<T> other, EqualityDelegate<T> equals) {
|
|
@@ -518,8 +518,8 @@ namespace Invercargill {
|
|
|
return series;
|
|
|
}
|
|
|
|
|
|
- public virtual Attempts<Tout> attempt_map_with<Tout>(Mapper<Tout, T> mapper) {
|
|
|
- return attempt_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() {
|