func join(arr []fooType) string { var agg multiType var none noneType return common.Join(arr, agg, none).(fooType).ToString() }
// Combine combines multiple R instances together and returns them // as a single one. func Combine(rs ...R) R { var aggregate combinedRecurring return common.Join(rs, aggregate, nilRecurring{}).(R) }
// SeriesTasks returns a task that performas all the passed in tasks in // series. If one of the tasks reports an error, the others following it // don't get executed. func SeriesTasks(tasks ...Task) Task { var aggregate seriesTasks return common.Join(tasks, aggregate, nilTask{}).(Task) }
// ParallelTasks returns a task that performs all the passed in tasks in // parallel. func ParallelTasks(tasks ...Task) Task { var aggregate parallelTasks return common.Join(tasks, aggregate, nilTask{}).(Task) }
// All returns a Filterer that returns nil if all of the // fs return nil. Otherwise it returns the first error encountered. func All(fs ...Filterer) Filterer { var aggregate andFilterer return common.Join(fs, aggregate, trueF).(Filterer) }
// Any returns a Filterer that returns Skipped if all of the fs return // Skipped. Otherwise it returns nil or the first error not equal to Skipped. func Any(fs ...Filterer) Filterer { var aggregate orFilterer return common.Join(fs, aggregate, falseF).(Filterer) }