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

Why is unescapeBytea in IO? #56

Open
ysangkok opened this issue Feb 13, 2024 · 1 comment
Open

Why is unescapeBytea in IO? #56

ysangkok opened this issue Feb 13, 2024 · 1 comment

Comments

@ysangkok
Copy link

This function seems pure to me, aside from the allocation that it does. But Haskell allocates in many places, and we still call those functions pure. I don't understand why unescapeBytea must be in IO? What kind of side effects can it perform?

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2024

But Haskell allocates in many places, and we still call those functions pure.

Sure, bytestring is littered with unsafePerformIOs.

But, there aren't a single unsafePerformIO in postgresql-libpq, so the bar of introducing the first one is extremely high.

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