Skip to content

Commit 83f24b6

Browse files
committed
Add a couple more instances
1 parent 3106116 commit 83f24b6

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

Codec/Compression/Zlib/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ data CompressParams = CompressParams {
106106
compressStrategy :: !Stream.CompressionStrategy,
107107
compressBufferSize :: !Int,
108108
compressDictionary :: Maybe S.ByteString
109-
}
109+
} deriving Show
110110

111111
-- | The full set of parameters for decompression. The defaults are
112112
-- 'defaultDecompressParams'.
@@ -132,7 +132,7 @@ data DecompressParams = DecompressParams {
132132
decompressBufferSize :: !Int,
133133
decompressDictionary :: Maybe S.ByteString,
134134
decompressAllMembers :: Bool
135-
}
135+
} deriving Show
136136

137137
-- | The default set of parameters for compression. This is typically used with
138138
-- the @compressWith@ function with specific parameters overridden.

Codec/Compression/Zlib/Stream.hsc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,10 @@ fromCompressionLevel (CompressionLevel n)
714714
data WindowBits = WindowBits Int
715715
| DefaultWindowBits -- This constructor must be last to make
716716
-- the Ord instance work. The Ord instance
717-
-- is defined with and used by the tests.
717+
-- is used by the tests.
718718
-- It makse sense because the default value
719719
-- is is also the max value at 15.
720-
deriving (Eq, Show, Typeable
720+
deriving (Eq, Ord, Show, Typeable
721721
#if __GLASGOW_HASKELL__ >= 702
722722
, Generic
723723
#endif

test/Test/Codec/Compression/Zlib/Internal.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE StandaloneDeriving #-}
21
{-# OPTIONS_GHC -fno-warn-orphans #-}
32

43
-- | Test code and properties for "Codec.Compression.Zlib.Internal"
@@ -12,8 +11,6 @@ import Test.QuickCheck
1211
import Control.Monad (ap)
1312

1413

15-
deriving instance Show CompressParams
16-
1714
instance Arbitrary CompressParams where
1815
arbitrary = return CompressParams `ap` arbitrary `ap` arbitrary
1916
`ap` arbitrary `ap` arbitrary
@@ -27,8 +24,6 @@ arbitraryBufferSize = frequency $ [(10, return n) | n <- [1..1024]] ++
2724
[(1, return n) | n <- [131072..1048576]]
2825

2926

30-
deriving instance Show DecompressParams
31-
3227
instance Arbitrary DecompressParams where
3328
arbitrary = return DecompressParams `ap` arbitrary
3429
`ap` arbitraryBufferSize

test/Test/Codec/Compression/Zlib/Stream.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE StandaloneDeriving #-}
21
{-# OPTIONS_GHC -fno-warn-orphans #-}
32

43
-- | Test code and properties for "Codec.Compression.Zlib.Stream"
@@ -24,7 +23,6 @@ instance Arbitrary CompressionLevel where
2423
++ map compressionLevel [1..9]
2524

2625

27-
deriving instance Ord WindowBits
2826
instance Arbitrary WindowBits where
2927
arbitrary = elements $ defaultWindowBits:map windowBits [8..15]
3028

0 commit comments

Comments
 (0)