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

Al Skipp al_skipp at fastmail.fm
Thu Dec 17 07:41:50 CST 2015


> On 17 Dec 2015, at 13:16, Will Fancher via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I do think that the use case of HKTs is limited mostly to those of us who really want to use Monads and the like. HKTs are a feature that I think round out Swift's generics' completeness, but the main application would be some niche third party packages that have various FP programming elements. If those libraries take off and become mainstream Swift, that's a sign that those libraries are a good thing to begin with. Otherwise, I doubt the horrible naming conventions of FP (and they are horrible) would be invasive to the Swift language as a whole.

Whatever names are decided upon for the general cases, ‘flatMap’, ‘bind’, ‘map’, ‘unit’, ‘pure’, or whatever, it’ll be impossible to have something that sounds appropriate for each particular instance. I suppose a Futures library could provide 'then’ and ‘after’ functions (or whatever is deemed best), these functions would themselves simply call into ‘map’ and ‘flatMap’. 


More information about the swift-evolution mailing list