Hacker News new | ask | show | jobs
by gmfawcett 2956 days ago
I get what you're saying too. :) I think one reasonable semantics for monadic I/O is that it sequences effects in a single thread; and effects from other threads are part of the world-state, not part of the monadic context. Another reasonable semantics is what I think you're describing: monadic I/O in a multithreaded program should sequence effects across all the threads (e.g., mutexes on shared resources). It would be nice to have both options available -- maybe similar to how you can plug a strategy into Haskell's Control.Parallel.Strategies monad.

https://hackage.haskell.org/package/parallel-3.2.1.1/docs/Co...