qtil
advanced-security/qtil-swift 0.0.3
Search

Module ListBuilder

A module for building CSV-like strings, or types that extend string, from a custom separator and/or custom types.

Each module provides predicates of2(...) to of8(...) for creating a list of up to 8 items, which take either a string or a custom type as input to be converted to a string. The result will either be a string, or a custom type that extends string.

The following modules are provided:

  • ListBuilder<separator>: Predicates to build a string from a list of string-valued arguments separated by a custom separator.
  • ListBuilderOf<separator, T, toString>: Predicates to build a string from a list of arguments of a custom type T, converted to strings via the toString predicate, using a custom separator.
  • TypedListBuilder<separator, S>: Predicates to build a string from a list of string-valued arguments separated by a custom separator, where the result is a custom type S that extends string.
  • TypedListBuilderOf<separator, S, T, toString>: Predicates to build a string from a list of arguments of a custom type T, converted to strings via the toString predicate, using a custom separator, where the result is a custom type S that extends string.

A recommended use of this module is by using the predicates defined in the qtil.strings.Chars module, which defines predicates such as Char::comma/0, Char::colon/0, Char::at/0, etc.

Import path

import qtil.list.ListBuilder

Imports

Char

A module that provides a Char class — a subtype of int representing a single character code, with utilities such as toUppercase(), isDigit(), and repeat(n).

Join

A module for joining strings with a separator, for example, join(":", "a", "b") = "a:b".

SignaturePredicates

A module for creating signature predicates without requiring separate declarations.

SignatureTypes

Modules

ListBuilder

A module that declares predicates of2(...) to of8(...) for building a string from a list of string-valued arguments separated by a custom separator.

ListBuilderOf

A module that declares predicates of2(...) to of8(...) for building a string from a list of arguments of a custom type T, converted to strings via the toString predicate, using a custom separator.

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.

TypedListBuilderOf

A module that declares predicates of2(...) to of8(...) for building a type that extends string from a list of arguments of a custom type T, converted to strings via the toString predicate, using a custom separator.