Map

public struct Map: Fn

Map applies lambda expression to each member of the Array or Page collection, and returns the results of each application in a new collection of the same type. If a Page is passed, its cursor is preserved in the result.

Map applies the lambda expression 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, to lambda: Expr)

    Parameters

    collection

    Collection to perform map.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

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

    Parameters

    collection

    Collection to perform map.

    lambda

    Lambda expression to apply to each collection item.

  • Declaration

    Swift

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

    Parameters

    collection

    Collection to perform map 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 map 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 map 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 map expression.

    lambda

    Lambda expression to apply to each collection item.