3 ms·
How Haskell deals with access to shared resources which are mutable by their nature, like file system, or the outside world? (A honest question, I start to thi
by IlliOnato 3y ago
How Haskell deals with access to shared resources which are mutable by their nature, like file system, or the outside world?
(A honest question, I start to think that I'd like to learn more on this language)
- andyferris 3y agoAFAIK they tend to operate through the IO monad, which serves to order read/write events and mark parts of your code as interacting with the global mutable state that lives outside your program. So the mutable (or is it “volatile”?) environment is there, but you explicitly know when and where you interact with it.
- whateveracct 3y agoHaskell has full support for IO and mutability. It even has software transactional memory in its standard library.