Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this person actually asking for Monads and Higher Kinded Types?

It would solve the problem they're raising but somehow I suspect that's now the solution they want to hear. And also the rust version would be quite hard to use due to the memory management model.



I think the author wants something like Ruby's blocks, although you're correct that monads would also be a good fit.

In Ruby, iteration can be performed by passing a sort-of-closure called a block. Unlike passing a closure (function), returning early from a block acts like returning from a for loop.

If a language has a garbage collector and no user-visible separation between stack and heap allocation, then there's lots of interesting things that language can do in terms of building "fluent" APIs.


In my experience, when it comes to language design, most people end up wanting monads and HKTs but refuse to admit it / are scared of admitting it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: