1
- {-# LANGUAGE CPP, RankNTypes, DeriveDataTypeable, BangPatterns #-}
1
+ {-# LANGUAGE CPP, RankNTypes, DeriveDataTypeable, DeriveGeneric, BangPatterns #-}
2
2
#if __GLASGOW_HASKELL__ >= 702
3
3
{-# LANGUAGE Trustworthy #-}
4
4
#endif
@@ -86,6 +86,9 @@ import qualified Control.Monad.ST.Unsafe as Unsafe (unsafeIOToST)
86
86
import qualified Control.Monad.ST.Strict as Unsafe (unsafeIOToST )
87
87
#endif
88
88
import Data.Typeable (Typeable )
89
+ #if __GLASGOW_HASKELL__ >= 702
90
+ import GHC.Generics (Generic )
91
+ #endif
89
92
import qualified Data.ByteString.Lazy as L
90
93
import qualified Data.ByteString.Lazy.Internal as L
91
94
import qualified Data.ByteString as S
@@ -115,7 +118,15 @@ data CompressParams = CompressParams {
115
118
compressStrategy :: ! Stream. CompressionStrategy ,
116
119
compressBufferSize :: ! Int ,
117
120
compressDictionary :: Maybe S. ByteString
118
- } deriving Show
121
+ } deriving
122
+ ( Eq -- ^ @since 0.7.0.0
123
+ , Ord -- ^ @since 0.7.0.0
124
+ , Show
125
+ , Typeable -- ^ @since 0.7.0.0
126
+ #if __GLASGOW_HASKELL__ >= 702
127
+ , Generic -- ^ @since 0.7.0.0
128
+ #endif
129
+ )
119
130
120
131
-- | The full set of parameters for decompression. The defaults are
121
132
-- 'defaultDecompressParams'.
@@ -141,7 +152,15 @@ data DecompressParams = DecompressParams {
141
152
decompressBufferSize :: ! Int ,
142
153
decompressDictionary :: Maybe S. ByteString ,
143
154
decompressAllMembers :: Bool
144
- } deriving Show
155
+ } deriving
156
+ ( Eq -- ^ @since 0.7.0.0
157
+ , Ord -- ^ @since 0.7.0.0
158
+ , Show
159
+ , Typeable -- ^ @since 0.7.0.0
160
+ #if __GLASGOW_HASKELL__ >= 702
161
+ , Generic -- ^ @since 0.7.0.0
162
+ #endif
163
+ )
145
164
146
165
-- | The default set of parameters for compression. This is typically used with
147
166
-- 'Codec.Compression.GZip.compressWith' or 'Codec.Compression.Zlib.compressWith'
@@ -236,7 +255,14 @@ data DecompressError =
236
255
-- wrong then you will get all the decompressed data but this error at the
237
256
-- end, instead of the normal successful 'Stream.StreamEnd'.
238
257
| DataFormatError String
239
- deriving (Eq , Typeable )
258
+ deriving
259
+ ( Eq
260
+ , Ord -- ^ @since 0.7.0.0
261
+ , Typeable
262
+ #if __GLASGOW_HASKELL__ >= 702
263
+ , Generic -- ^ @since 0.7.0.0
264
+ #endif
265
+ )
240
266
241
267
instance Show DecompressError where
242
268
show TruncatedInput = modprefix " premature end of compressed data stream"
0 commit comments