An opaque type alias would certainly make sense. We would need to somehow get both the opaque type and its binding into the syntax, e.g.,
private struct MyOpaqueCollectionImpl<T> { ... }
public typealias MyOpaqueCollection<T> = opaque Collection where _.Element == T
= MyOpaqueCollectionImpl<T>
Having two different meanings for =
is a little odd, so maybe we could use a different symbol for one of them. This would let us use MyOpaqueCollection<Something>
as a type basically anywhere in our APIs. It's known by its capabilities but its underlying type is unknown.
Doug