Skip to content

Conversation

@runeksvendsen
Copy link
Contributor

@runeksvendsen runeksvendsen commented Apr 3, 2022

I have only documented the "non-empty list"-requirement in the docs for waitAny and waitAnyCatch. I have refrained from adding it to the docs for waitAnyCancel, waitAnyCatchCancel, waitAnySTM, and waitAnyCatchSTM since the docs for these functions refer to either waitAny or waitAnyCatch.

Closes #130

--
-- @since 2.1.0
waitAnyCatchSTM :: [Async a] -> STM (Async a, Either SomeException a)
waitAnyCatchSTM [] = error "waitAnyCatchSTM: invalid argument: input list must be non-empty"
Copy link
Owner

Choose a reason for hiding this comment

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

  1. please throw an exception, don't use error
  2. keep lines under 80 columns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. please throw an exception, don't use error

In the associated issue you said using ErrorCall is fine. And calling error is the same as throwing ErrorCall according to https://www.stackage.org/haddock/lts-19.5/base-4.15.1.0/Control-Exception.html#t:ErrorCall. What am I missing?

Copy link
Owner

Choose a reason for hiding this comment

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

Also: keep columns under 80 chars
@runeksvendsen runeksvendsen requested a review from simonmar May 13, 2022 08:01
@simonmar simonmar merged commit f66d729 into simonmar:master Jun 27, 2022
@runeksvendsen runeksvendsen deleted the waitany-empty-list branch June 27, 2022 07:55
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.

Missing documentation: waitAny [] throws BlockedIndefinitelyOnSTM

2 participants