Combine introduced two Codable-related protocols to represent top level encoders and decoders. The
TopLevelEncoder is used to abstract
PropertyListEncoder for use in the
encode(encoder:) operator. Decodable counterparts are also provided.
I think these protocols would be useful in the standard library for two main reasons:
Vendors of custom encoding/decoding packages wanting to participate in this environment would need to import Combine to do so, which may be undesirable.
Packages that want to provide functionality that is agnostic to the specific encoder/decoders being used, would also have to import Combine.
The requirement of Combine limits its use, especially as data manipulation packages would generally be cross-platform, where Combine is not available.