Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Thanks, i will try to learn about STM. It looks like there are more methods in Haskell to have mutability and state (i've stumbles upon MVar, State, ST), so i'll need to figure out their differences and intended uses. Commented Dec 19, 2015 at 13:36
  • @Alexey: Good point regarding ST, IMO it should be mentioned in the answer because it allows to run a stateful computation, then throw away the state and extract the result as a pure value. Commented Dec 19, 2015 at 13:38
  • @Giorgio, is it possible to use Haskell's ST with STM to have both concurrency and disposable state? Commented Dec 24, 2015 at 11:17
  • Just one more terminology suggestion: the composed main IO action is not "returned by the main function" but is assigned to main variable. :) (main does not even hold a function.) Commented Dec 24, 2015 at 21:31
  • I see your point, but still "variable" has a connotation in most people's minds as a simple value, rather than a process that produces a value, and main is clearly better thought of as the latter rather than the former. The change you suggest, while clearly technically correct, has the potential to confuse those unfamiliar with the subject. Commented Dec 24, 2015 at 22:20