<|? operator

The <|? operator is used to decode an optional value at the specified key path into the requested type:

public func <|? <A: Decodable>(json: JSON, keys: [String]) -> Decoded<A?> where A == A.DecodedType { 
switch flatReduce(keys, initial: json, combine: decodedJSON) {
case .failure: return .success(.none)
case .success(let x): return A.decode(x) >>- {
.success(.some($0)) }
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset