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

General cleanup #13

Closed
chshersh opened this issue Jul 19, 2018 · 5 comments
Closed

General cleanup #13

chshersh opened this issue Jul 19, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@chshersh
Copy link
Contributor

  • list
  • Lifted.ST
  • getContents
  • interact
  • getArgs
  • note
@manifoldhiker
Copy link

Why getContents considered harmful?

@chshersh
Copy link
Contributor Author

chshersh commented Sep 4, 2018

@kilianovski Input string for getContents can be huge. And since we have strict Text by default, it will store whole content in memory instead of reading in lazily. Having other type for getContents makes API inconsistent and weird.

@wbadart
Copy link

wbadart commented Dec 7, 2020

Any recommendations for a safer/ saner interact?

@chshersh
Copy link
Contributor Author

chshersh commented Dec 8, 2020

@wbadart This depends on your use-case. The default interact for String is lazy which makes it work only for specific use-cases. I recommend reading the following SO question and answer that explains low-level details:

You can try using interact for lazy Text or lazy ByteString but the documentation doesn't describe the behaviour precisely.

My general advice would be to not use interact at all, and rewrite the application in a different way.

@wbadart
Copy link

wbadart commented Dec 8, 2020

Gotcha. Thanks for the tips!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants