Hacker News new | past | comments | ask | show | jobs | submit login

I don't think people using monadic concurrency in haskell or ocaml will agree with this.



IO in Haskell (and presumably Lwt in OCaml, though I'm less familiar with it) doesn't have much to do with fibers.

An IO value is just something that the Haskell runtime is able to invoke somehow. Haskell functions can not directly run IO values (ignoring unsafePerformIO). A fairly elegant implementation would probably simply make IO values be asynchronous operations (procedures that take an "on complete" callback that receives the result)—again, since there's no way for a Haskell function to actually run the operation, all it can do is return such an operation to the runtime to be called.


Monads don't have much to do with it, but the GHC runtime uses fibers for concurrency, no?


Monadic code can be polymorphically async-or-not in a safe way rather than just making all your yield points invisible.




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

Search: