Foreach

public struct Foreach: Fn

Foreach applies lambda expr to each member of the Array or Page coll. The original collection is returned.

Foreach applies the lambda expr concurrently to each element of the collection. Side-effects, such as writes, do not affect evaluation of other lambda applications. The order of possible refs being generated within the lambda are non-deterministic.

Reference.

  • Declaration

    Swift

    public init(collection: Expr, in lambda: Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

    public init(_ collection: Expr, _ lambda: (Expr) -> Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

    public init(_ collection: Expr, _ lambda: ((Expr, Expr)) -> Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

    public init(_ collection: Expr, _ lambda: ((Expr, Expr, Expr)) -> Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

    public init(_ collection: Expr, _ lambda: ((Expr, Expr, Expr, Expr)) -> Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

    public init(_ collection: Expr, _ lambda: ((Expr, Expr, Expr, Expr, Expr)) -> Expr)

    Parameters

    collection

    Collection to perform foreach expression.

    lambda

    Lambda expression to apply to each collection item.