# \[Pitch\] Have all adapters in the standard library uniformly expose their \`base\`

**URL:** <https://forums.swift.org/t/pitch-have-all-adapters-in-the-standard-library-uniformly-expose-their-base/56830>\
**Category:** Pitches\
**Tags:** stdlib\
**Created:** [April 19, 2022, 8:09pm UTC](https://forums.swift.org/t/pitch-have-all-adapters-in-the-standard-library-uniformly-expose-their-base/56830 "2022-04-19T20:09:03Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![lukasa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukasa/32/1232_2.png) [@lukasa](https://forums.swift.org/u/lukasa)\
**Post date:** [April 20, 2022, 4:40pm UTC](https://forums.swift.org/t/pitch-have-all-adapters-in-the-standard-library-uniformly-expose-their-base/56830/24 "2022-04-20T16:40:49Z")

</div>

> [@Nevin](#):
>
> Second, if and when the standard library does eventually add the conformance, the programmer (Dave) is not going to say “Ugh, this breaks my code.” No. Instead they’re going to say “Hallelujah! Finally! I’ve been waiting years for this! I can delete so much boilerplate! This is fantastic!”
> 
> The programmer _wants_ the standard library to add the conformance. They are frustrated that is has not yet done so. And they are even more frustrated that the standard library actively prevents them from adding the conformance themself. It is harming their productivity.

The risk is that when the standard library adds the conformance, the programmer is long gone. Dave wrote his application, it's shipped, and two years later Apple ships an update to the OS that adds the conformance. Now we run directly into the problems outlined in [Retroactive Conformances vs. Swift-in-the-OS](https://forums.swift.org/t/retroactive-conformances-vs-swift-in-the-os/14393). The programmer _today_ wants the conformance, but they're long gone and their app is busted. As is well documented [in the annals of computing history](https://web.archive.org/web/20110522151222/http://blogs.msdn.com/b/oldnewthing/archive/2003/12/23/45481.aspx), users will rightly blame the last thing that moved: after all, the app worked before and now it doesn't, and the app sure as hell didn't change.

Another constituency you're missing here is library authors. Library authors absolutely must not add retroactive conformances because, again, they're often not able to fix the problems those retroactive conformances cause. Many libraries become essentially unmaintained, or you are forced by other circumstances to use older versions of them. In this instance, the user of the library may not even have known the retroactive conformance was there, but now it's their problem, and they have the unpalatable choice of either forking the library or removing its use.

Put another way, the issue with retroactive conformances is that they fix today's problem by signing up for a future problem, one which will strike without warning and likely fall on a very different person than the one who benefited from the fix.

> [@Nevin](#):
>
> And you are saying, “The ravine might eventually get filled in by a public-works project years from now. If that happens you won’t need a bridge, and any bridge you did build would be destroyed. So I think the reason you want an anchor point is _terrible_ . Bad enough to taint the entire idea of installing an anchor point, regardless of what else it might be used for.”

This analogy isn't the point, but: in this analogy, the issue is that "would be destroyed" is in the passive voice. A better one would be:

"This ravine might eventually get filled in by a public-works project years from now, at which time we will be unaware that you have built a bridge and so will knock it down _by accident_ in an uncontrolled fashion, potentially causing it to fall on whatever lies beneath it. We will be liable for that destruction, not you, and so we would really much rather you didn't build the bridge and certainly have no intention to make it easier for you."

> [@Nevin](#):
>
> Having the anchor point today would be useful.

_This_, however, I agree with. I agree with @lorentey that exposing `_base` _because_ we want to use it to implement retroactive conformances is a bad idea. But I think exposing it is a good idea: it enables entire classes of algorithms that are otherwise awkward to implement, it costs very little in flexibility of evolution because the types are frozen anyway, and ultimately I have a "consenting adults" view of API design. But I definitely understand why the stdlib devs are hesitant to expose this implementation detail, and if this were the problem I had I would _absolutely_ just copy the implementation myself and move on.

---

_[View the full topic](https://forums.swift.org/t/pitch-have-all-adapters-in-the-standard-library-uniformly-expose-their-base/56830)._
