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

Pure functions allow the runtime to make an entire set of assumptions that aren't safe with other languages.


Given that you 'forkIO' functions in the IO monad, i.e. impure functions, what do you mean by that? 'forkIO' in Haskell is essentially the same as dispatching a green thread in any other language, e.g. the same as 'go' in Go.

Haskell/GHC's threads are primarily a concurrency construct, not a parallelism one. You 'forkIO' a bunch of impure functions and communicate between them using channels, STM, etc., exactly the same as in other languages. For parallelism in pure functions there are much better tools--par seq, parallel strategies, repa, Data Parallel Haskell, etc.


I didn't realize that Haskell supported M:N threading in IO contexts. In that case, I don't have an answer to the original question.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: