Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fbut: discussion about IO #24

Closed
hasufell opened this issue Jun 15, 2015 · 2 comments
Closed

fbut: discussion about IO #24

hasufell opened this issue Jun 15, 2015 · 2 comments

Comments

@hasufell
Copy link

I feel the section about IO is a bit short there. A frequently brought up topic in #haskell and pretty much anywhere else is that people refer to IO in terms of side effects. I'm not sure how you see this, since there are different definitions of "side effects", but afaiu the purpose of haskell IO is exactly that: having IO without side effects, because... the fact that we "do" IO is represented by the type and that is the effect. It's not hidden, it doesn't happen outside of the type system or without the compiler or developer knowing, so it's simply an effect, not a side effect.

If we don't see it that way, then I don't see any way to call haskell pure anymore. Opinions?

@quchen
Copy link
Owner

quchen commented Jun 15, 2015

Whether you consider IO to be pure depends on who you ask in which context. There is only one function that can perform IO and that's main (apart from black magic), and main is called by the runtime, so you have ordinary IO values during compilation that have nothing to do with side effects. On the other hand, the purpose of IO is to be performed of course, causing arbitrary side effects, so it has an impure feeling to it. I don't think I can answer the question of whether IO is pure or not well enough to write about it to be honest :-|

@quchen
Copy link
Owner

quchen commented Aug 18, 2015

I'll close this because I don't know what to do with the suggestion right now. I'll keep an eye open for IO-purity-related discussions in the future though.

@quchen quchen closed this as completed Aug 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants