1- {-# LANGUAGE CPP, RankNTypes, DeriveDataTypeable, BangPatterns #-}
1+ {-# LANGUAGE CPP, RankNTypes, DeriveDataTypeable, DeriveGeneric, BangPatterns #-}
22#if __GLASGOW_HASKELL__ >= 702
33{-# LANGUAGE Trustworthy #-}
44#endif
@@ -86,6 +86,9 @@ import qualified Control.Monad.ST.Unsafe as Unsafe (unsafeIOToST)
8686import qualified Control.Monad.ST.Strict as Unsafe (unsafeIOToST )
8787#endif
8888import Data.Typeable (Typeable )
89+ #if __GLASGOW_HASKELL__ >= 702
90+ import GHC.Generics (Generic )
91+ #endif
8992import qualified Data.ByteString.Lazy as L
9093import qualified Data.ByteString.Lazy.Internal as L
9194import qualified Data.ByteString as S
@@ -115,7 +118,15 @@ data CompressParams = CompressParams {
115118 compressStrategy :: ! Stream. CompressionStrategy ,
116119 compressBufferSize :: ! Int ,
117120 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+ )
119130
120131-- | The full set of parameters for decompression. The defaults are
121132-- 'defaultDecompressParams'.
@@ -141,7 +152,15 @@ data DecompressParams = DecompressParams {
141152 decompressBufferSize :: ! Int ,
142153 decompressDictionary :: Maybe S. ByteString ,
143154 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+ )
145164
146165-- | The default set of parameters for compression. This is typically used with
147166-- 'Codec.Compression.GZip.compressWith' or 'Codec.Compression.Zlib.compressWith'
@@ -236,7 +255,14 @@ data DecompressError =
236255 -- wrong then you will get all the decompressed data but this error at the
237256 -- end, instead of the normal successful 'Stream.StreamEnd'.
238257 | 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+ )
240266
241267instance Show DecompressError where
242268 show TruncatedInput = modprefix " premature end of compressed data stream"
0 commit comments