Skip to content

Conversation

@infinity0
Copy link
Contributor

Originally part of #428. Hopefully the code & commit messages should be self-explanatory. TD;LR version is that bind doesn't clean up after itself, this works around that.

res <- try (G.bind s a)
case res of
Right () -> pure ()
Left e -> if not (isAlreadyInUseError (e :: IOException))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use | isAlreadyInUseError (e :: IOException) instead of if.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8d5ff8d - though I've kept the error conditions grouped together at the top as I think that's visually easier to read, hope that's OK.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't forget pure in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, also done now in f27b87c

Copy link
Collaborator

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kazu-yamamoto added a commit to kazu-yamamoto/network that referenced this pull request May 25, 2020
@kazu-yamamoto
Copy link
Collaborator

Rebased and merged. Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants