-
Notifications
You must be signed in to change notification settings - Fork 11
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
DecompressParams
should be modifiable?
#5
Comments
@taktoa The Haddock documentation doesn't make it obvious, but the functions under http://hackage.haskell.org/package/lzma-0.0.0.3/docs/Codec-Compression-Lzma.html#g:6 are actually the field accessors. So you can in fact use record-update syntax such as e.g. defaultDecompressParams { decompressAutoDecoder = True, decompressMemLimit = 16777216 } Btw, the reason for not exposing the constructor is so that we don't have to perform major version bumps each time a new field is added to Why do you believe that the deprecated .lzma format should be auto-detected by default? |
Ah, my bad. Is there a way to convince Haddock to output more sane documentation for this? Regarding the |
Good point. I'll try to add some visible hints in the documentation for both, the auto-decoder-default as well as the Haddock-rendering issue of showing field updaters as ordinary functions. Fwiw, I went with what the default was with the LZMA_FORMAT_ERROR = 7,
/**<
* \brief File format not recognized
*
* The decoder did not recognize the input as supported file
* format. This error can occur, for example, when trying to
* decode .lzma format file with lzma_stream_decoder,
* because lzma_stream_decoder accepts only the .xz format.
*/ |
There's currently no function exported from
Codec.Compression.Lzma
that allowsdefaultDecompressParams
to be customized. It seems to me that, this being the case, either the constructor/fields ofDecompressParams
should be exported, or, if this was the intended semantics, there is no point in exportingdecompressWith
orDecompressParams
at all. SinceLibLzma
is not an exposed module there is simply no way to create a value of typeDecompressParams
other than the default.The same argument also applies to
CompressParams
. The current interface is about as useful as a module with the following exports:So, IMO, the interface should be simplified to the above (if this is what is intended), or the constructor/fields for
CompressParams
/DecompressParams
should be exposed.BTW, unless I'm ignorant of some other factor,
decompressAutoDecoder
should probably default toTrue
.The text was updated successfully, but these errors were encountered: