[swift-evolution] [Proposal] Higher Kinded Types (Monads, Functors, etc.)

Dave Abrahams dabrahams at apple.com
Wed Dec 16 19:10:59 CST 2015

> On Dec 16, 2015, at 1:34 PM, Douglas Gregor <dgregor at apple.com> wrote:
> With higher-kinded types, one could potentially [*] produce a collection of the same kind as Self but with the element type T. So, mapping a Set produces a Set, mapping an Array produces an Array, etc. 

Yeah, but Set can’t follow the functor laws, so that map won’t apply to it.  That’s why, while I agree that this kind of constraint is helpful and important for completing the generics picture, IMO it is probably less helpful/important than many people think.


More information about the swift-evolution mailing list