struct
LazySequence
<
S
:
SequenceType
>
Inheritance |
SequenceType, _SequenceType, _Sequence_Type
View Protocol Hierarchy →
|
---|---|
Associated Types |
Type alias inferred.
Type alias inferred. |
Import |
|
Initializers
Construct an instance with base
as its underlying sequence
instance.
Declaration
init
(
_
base
:
S
)
Instance Variables
an Array, created on-demand, containing the elements of this lazy SequenceType.
Declaration
var
array
: [
S
.
Generator
.
Element
] {
get
}
Instance Methods
Return a lazy SequenceType containing the elements x
of source
for
which includeElement(x)
is true
Declaration
func
filter
(
includeElement
: (
S
.
Generator
.
Element
) -
>
Bool
) -
>
LazySequence
<
FilterSequenceView
<
S
>
>
Return a generator over the elements of this sequence.
Complexity: O(1)
Declaration
func
generate
() -
>
S
.
Generator
Return a MapSequenceView
over this LazySequence
. The elements of
the result are computed lazily, each time they are read, by
calling transform
function on a base element.
Declaration
func
map
<
U
>
(
transform
: (
S
.
Generator
.
Element
) -
>
U
) -
>
LazySequence
<
MapSequenceView
<
S
,
U
>
>
A sequence that forwards its implementation to an underlying sequence instance while exposing lazy computations as methods.