Higher-kinded abstraction in Swift

Originator:jonsterling
Number:rdar://17203161 Date Originated:
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
Currently, the only things that may be quantified over in Swift are base types (things of kind `Type`). It would be very useful of type constructors (things of kind `Type -> Type`) could also be abstracted over.

Steps to Reproduce:
````
protocol Endofunctor {
    typealias F<_>
    static func map<A,B>(A -> B) -> (F<A> -> F<B>)
}
````

Expected Results:
A protocol which quantifies over type constructors instead of types could be constructed. This is necessary in order to express functors, monads, traversables, and the entire menagerie of useful abstractions.

Actual Results:
This is not currently supported in Swift.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!