-
Notifications
You must be signed in to change notification settings - Fork 31
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
Switch to unliftio and lts-11.1 #83
Conversation
c27e461
to
c7a0c0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the one comment in limitedMapConcurrently
rest of the changes LGTM. 👍
src/Network/Minio/Utils.hs
Outdated
contentTypeMay resp = lookupHeader Hdr.hContentType $ NC.responseHeaders resp | ||
|
||
-- Similar to mapConcurrently but limits the number of threads that | ||
-- can run using a quantity semaphore. | ||
limitedMapConcurrently :: (MonadIO m, R.MonadBaseControl IO m) | ||
limitedMapConcurrently :: MonadUnliftIO m | ||
=> Int -> (t -> m a) -> [t] -> m [a] | ||
limitedMapConcurrently count act args = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to handle the case where count
could be zero. One way to do it is,
limitedMapConcurrently 0 _ _ = return []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
- Also add .stylish-haskell.yaml - Re-implements `limitedMapConcurrently` using STM - Dependencies clean up in cabal file - Fix shadow warnings and other build warnings
limitedMapConcurrently
using STM