axman6 / amazonka-s3-streaming

Provides a conduit based interface to uploading data to S3 using the Multipart API
MIT License
20 stars 23 forks source link

Use MonadFail constraint #18

Closed utdemir closed 4 years ago

utdemir commented 5 years ago

As per MonadFailProposal's last step, fail is removed from Monad and instead provided by MonadFail starting from base-4.13.

MonadFail typeclass was introduced on base-4.9 coming with GHC 8.x; so this PR bumps the lower bound of base to reflect that. This makes the library explicitly drop support for GHC 7.x; let me know if this is important for you, we might need to add some CPP in that case.

This PR adds MonadFail constraints to functions using fail. This is technically a backwards-incompatible change since there's an additional constraint on the public API, but practically it is not a big issue since monads with MonadIO instances usually comes with MonadFail too.

utdemir commented 5 years ago

Also, it'd be great if you can publish a release with this change :).

axman6 commented 4 years ago

Version 1.1.0.0 has been released to Hackage with these changes. Thanks @utdemir

utdemir commented 4 years ago

Turns out AWST from amazonka does not come with a MonadFail instance :(. I am assuming AWST is the most common monad to use with this library, so I think this change seriously hinders the common use case on GHC versions older than GHC 8.8.

I sent a PR to amazonka adding the MonadFail instance: https://github.com/brendanhay/amazonka/pull/551. However given that amazonka library has 22 other open PR, it will probably take a while for that to get merged.

I think there is still no need to revert this change since there are workarounds. Users can always depend on the older version of this library, or they can wrap AWST with a wrapper with a MonadFail instance or they can implement an orphan instance.

Sorry about this.