<div dir="ltr"><div><br></div><div><br></div><div>## The Issue</div><div>Given </div><div>``` swift</div><div>public protocol Zipper1D : CustomStringConvertible {</div><div>    associatedtype Element</div><div>}</div><div>```</div><div><br></div><div>We can almost write a `flatMap`  which keeps the general identity of self and swaps out the Element in the output.</div><div><br></div><div>``` swift</div><div>func flatMap&lt;</div><div>        NewElement, SegmentOfResult : Collection, Output : Zipper1D where</div><div>        SegmentOfResult.Iterator.Element == NewElement, Output.Element == NewElement&gt;</div><div>        (_ transform: @noescape (Element) throws -&gt; SegmentOfResult) rethrows -&gt; Output</div><div>```</div><div><br></div><div>## The Proposal</div><div>I propose that we allow `Type.withoutSpecialization`</div><div><br></div><div>``` swift</div><div>func flatMap&lt;</div><div>        NewElement, SegmentOfResult : Collection, Output : Zipper1D where</div><div>        SegmentOfResult.Iterator.Element == NewElement, Output.Element == NewElement, Output.withoutSpecialization == Self.withoutSepcialization&gt;</div><div>        (_ transform: @noescape (Element) throws -&gt; SegmentOfResult) rethrows -&gt; Output</div><div>```</div><div><br></div><div><br></div><div>I recognize that generic protocols are another possible solution to this problem. I am pitching this because of how much closer this idea seems to being realized.</div></div>