Function
strictMap(_:_:)
Given one or more optionals as inputs, checks whether each input is
nil. If any input is nil, nil is immediately returned as an overall results. If all of the inputs have values, the transform callback is invoked with all of the unwrapped values as parameters.func strictMap<A, Res>(_ a: A?, _ transform: (A) throws -> Res) rethrows -> Res?
Discussion
Note
This “baseline”, single-item version of the function is trivially re-expressible using the ?? operator or Optional.map(_:), but this is not the case for any of the other overloads.
See Also
Optionals
strictMap(_:_:_:)strictMap(_:_:)over 2 optionals.strictMap(_:_:_:_:)strictMap(_:_:)over 3 optionals.strictMap(_:_:_:_:_:)strictMap(_:_:)over 4 optionals.strictMap(_:_:_:_:_:_:)strictMap(_:_:)over 5 optionals.strictMap(_:_:_:_:_:_:_:)strictMap(_:_:)over 6 optionals.strictMap(_:_:_:_:_:_:_:_:)strictMap(_:_:)over 7 optionals.strictMap(_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 8 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 9 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 10 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 11 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 12 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 13 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 14 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 15 optionals.strictMap(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)strictMap(_:_:)over 16 optionals.