|
|
|
|
|
by sordina
4156 days ago
|
|
You're right that Haskell doesn't distinguish different IO actions other than by the type they return. There are certainly libraries that do this though, although they aren't widely used. Even though Haskell doesn't distinguish different classes of IO actions, it still distinguishes IO actions from other kinds of actions (such as stateful actions as per your example), and pure computations and that provides a hell of a lot of bang for buck. The Idris language has the notion of effect types [1] to make achieving the goal of categorising the kinds of effects being used in a function easier to deal with, but that uses the dependent capabilities of the language. [1] http://eb.host.cs.st-andrews.ac.uk/drafts/eff-tutorial.pdf |
|
I use them in every single application I write, or I make my own tighter, more specific ones. They're incredibly useful in real world apps.