[swift-evolution] [Proposal] Higher Kinded Types (Monads, Functors, etc.)
krzysztof at siejkowski.net
Thu Dec 17 06:03:37 CST 2015
> Optional.map and Array.map do different things, and unifying them seems harmful.
They actually don’t do different things. Optional can be thought of as an array of zero or one elements; from that point of view, operations like `map` and `flatMap` which are supported on both actually do the same thing.
This discussion convinces me to vote -1 for the HKTs in standard library.
For the programmers without functional programming background HKTs gonna be misleading and non-readable. A thousand similar analogies: "<OneMonad> can be seen as <OtherMonad>" will need to be made. Those analogies are gonna break (for example, how would one explain monad transformers in those terms?) and lead to even more confusion.
As long as the underlying theory is not widely adopted, I think HKTs should be provided by third-party libraries (like swiftz). Swift should just provide generics sophisticated enough to express the those concepts. Scala language uses similar approach (no HKTs in standard library, great generics) with success (scalaz, shapeless libraries).
swift-evolution mailing list
swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution