<*>(_:_:)

public func <*><T, U>(_ transform: [(T) -> U], arg: [T]) -> [U]

Sequential application.

Apply all functions to the all values.

Example:

let parsers: [(JSON) -> Operation?] = ...
let data: [JSON] = ...
// operations is [Operation?]
let opetations = parsers <*> json
// cleanOperations is [Operation]
let cleanOperations = operations.flatMap { $0 }
  • T

    Declaration

    Swift

    public func <*><T, U>(_ transform: [(T) -> U], arg: [T]) -> [U]