func map<T>(_ transform: (String) throws -> T) rethrows -> [T]
[Swift] - 고차함수(Map,Filter,Reduce), allSatisfy, forEach
func compactMap<ElementOfResult>(_ transform: (Int?) throws -> ElementOfResult?) rethrows -> [ElementOfResult]
func flatMap<SegmentOfResult>(_ transform: ([Int]) throws -> SegmentOfResult) rethrows -> [SegmentOfResult.Element] where SegmentOfResult : Sequence
let possibleNumbers = ["0", "2", "three", "사", "5"]
let compactMapped = possibleNumbers.compactMap { str in Int(str) }
// [0, 2, 5]
let notYetFlatMapped = [[1], [2, 3], [4, 5, 6], [7, 8, 9, 10]]
let flatMapped = notYetFlatMapped.flatMap { $0 }
print(flatMapped)
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
let operators = Operator.allCases.map { String($0.rawValue) }
let operandsList = operandElements.compactMap { Double($0) }