mrkkrp / zip

Efficient library for manipulating zip archives
Other
81 stars 27 forks source link

Generalizing BZip2Unsupported and ZstdUnsupported #102

Closed msakai closed 1 year ago

msakai commented 1 year ago

This PR contains two changes:

  1. Currently, BZip2Unsupported and ZstdUnsupported are defined only when the library is built without support for respective compression methods. But this means it is necessary to know under which configuration the zip library is built to handle those exceptions. Using conditional compilation based on the information is a burden for application development. So I propose to define those data constructors unconditionally.

  2. Since the only difference between BZip2Unsupported and ZstdUnsupported are compression method, I propose to unify them as a single data constructor UnsupportedCompressionMethod. This makes it easier to add other compression methods in the future. Compatibility is maintained using pattern synonyms.

mrkkrp commented 1 year ago

Hey, I think it is a good idea. Maybe we should be more brave about it though: provide no pattern synonyms for compatibility, but instead bump to version 2.0.0?

Can you please

msakai commented 1 year ago

Sure!

I fixed the code to satisfy Ormolu, removed pattern synonyms, bumped the version to 2.0, and updated CHANGELOG.md.

mrkkrp commented 1 year ago

Thanks!