Module TypedListBuilder
A module that declares predicates of2(...) to of8(...) for building a type that extends
string from a list of string-valued arguments separated by a custom separator.
To build a string (rather than a type that extends string) from a list of string-valued
arguments, use ListBuilder<separator>. To build a string from non-string arguments, use
ListBuilderOf<separator, T, toString>. To build a type that extends string from non-string
arguments, use TypedListBuilderOf<separator, T, S, toString>.
Example usage:
bindingset[this]
class MyString extends string {
bindingset[this]
string reverse() {
result = concat(string c, int idx | c = this.charAt(idx) | c order by idx desc)
}
}
// Selects "rab,oof".
// Resulting type is of `MyString`, which allows for the `.reverse()` member predicate here.
select TypedListBuilder<Separator::comma/0, MyString>
::of2("foo", "bar")
.reverse()
Import path
import qtil.list.ListBuilderImports
| TypedListBuilderOf<TypedListBuilder::separator, TypedListBuilder::S, string, TypedListBuilder::identity> | A module that declares predicates |
Parameters
| separator | pred | |
| S | StringlikeType |