Returns the element type of a Genable
Returns the union of the element types of a tuple of generators.
a tuple type of Genable's.
Any Generator
, Iterator
, or Iterable
, which can be coerced to a
EnhancedGenerator.
the value type produced by the Genable
A function which can be supplied to a reduce method.
For the case where an init value of type A will be supplied, use:
For the case where no init value will be supplied, use:
For cases where an init value may or may not be supplied:
For cases where A = T (for example, reducing a set of numbers to a number):
The accumulated result.
The individual element values supplied to be reduced.
the initial value for the reducer. If no init value is supplied, the first call will be T; otherwise it will be A.
Predicate/type guard to determine if an object is (or looks like, structurally) a Generator.
Predicate/type guard, returns true
if the argument satisfies the Iterable
protocol (has a [Symbol.iterator]
method).
Predicate/type guard, returns true
if the argument satisfies the Iterable
protocol (has a [Symbol.iterator]
method) and the Iterator
protocol (a next() method).
Predicate/type guard, returns true
if the argument satisfies the Iterator
protocol (has a next()
method).
(default = 0)
(default = Number.MAX_SAFE_INTEGER
)
(default = 1)
Coerce an object to an object that can act as a generator (that is, satisfy both Iterator
and Iterable
).
If it is an Iterator
but not Iterable
, or Iterable
but not Iterator
, it is wrapped
in a generator.
Similar to toGenerator, but does not require the presence of Generator.return
or Generator.throw
methods.
Generated using TypeDoc
An extension to generators, that provides for operations like: