1
- {-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable, DeriveGeneric #-}
1
+ {-# LANGUAGE CPP, ForeignFunctionInterface, DeriveDataTypeable #-}
2
+ #if __GLASGOW_HASKELL__ >= 702
3
+ {-# LANGUAGE DeriveGeneric #-}
4
+ #endif
2
5
-----------------------------------------------------------------------------
3
6
-- |
4
7
-- Copyright : (c) 2006-2014 Duncan Coutts
@@ -119,7 +122,9 @@ import Control.Monad.ST.Strict
119
122
#endif
120
123
import Control.Exception (assert )
121
124
import Data.Typeable (Typeable )
125
+ #if __GLASGOW_HASKELL__ >= 702
122
126
import GHC.Generics (Generic )
127
+ #endif
123
128
#ifdef DEBUG
124
129
import System.IO (hPutStrLn , stderr )
125
130
#endif
@@ -565,7 +570,11 @@ fromFlush Finish = #{const Z_FINISH}
565
570
-- variations.
566
571
--
567
572
data Format = GZip | Zlib | Raw | GZipOrZlib
568
- deriving (Eq , Ord , Enum , Bounded , Show , Typeable , Generic )
573
+ deriving (Eq , Ord , Enum , Bounded , Show , Typeable
574
+ #if __GLASGOW_HASKELL__ >= 702
575
+ , Generic
576
+ #endif
577
+ )
569
578
570
579
{-# DEPRECATED GZip "Use gzipFormat. Format constructors will be hidden in version 0.7" #-}
571
580
{-# DEPRECATED Zlib "Use zlibFormat. Format constructors will be hidden in version 0.7" #-}
@@ -610,7 +619,11 @@ formatSupportsDictionary _ = False
610
619
-- | The compression method
611
620
--
612
621
data Method = Deflated
613
- deriving (Eq , Ord , Enum , Bounded , Show , Typeable , Generic )
622
+ deriving (Eq , Ord , Enum , Bounded , Show , Typeable
623
+ #if __GLASGOW_HASKELL__ >= 702
624
+ , Generic
625
+ #endif
626
+ )
614
627
615
628
{-# DEPRECATED Deflated "Use deflateMethod. Method constructors will be hidden in version 0.7" #-}
616
629
@@ -634,7 +647,11 @@ data CompressionLevel =
634
647
| BestSpeed
635
648
| BestCompression
636
649
| CompressionLevel Int
637
- deriving (Eq , Show , Typeable , Generic )
650
+ deriving (Eq , Show , Typeable
651
+ #if __GLASGOW_HASKELL__ >= 702
652
+ , Generic
653
+ #endif
654
+ )
638
655
639
656
{-# DEPRECATED DefaultCompression "Use defaultCompression. CompressionLevel constructors will be hidden in version 0.7" #-}
640
657
{-# DEPRECATED NoCompression "Use noCompression. CompressionLevel constructors will be hidden in version 0.7" #-}
@@ -694,7 +711,11 @@ data WindowBits = WindowBits Int
694
711
-- is defined with and used by the tests.
695
712
-- It makse sense because the default value
696
713
-- is is also the max value at 15.
697
- deriving (Eq , Show , Typeable , Generic )
714
+ deriving (Eq , Show , Typeable
715
+ #if __GLASGOW_HASKELL__ >= 702
716
+ , Generic
717
+ #endif
718
+ )
698
719
699
720
{-# DEPRECATED DefaultWindowBits "Use defaultWindowBits. WindowBits constructors will be hidden in version 0.7" #-}
700
721
-- FIXME: cannot deprecate constructor named the same as the type
@@ -750,7 +771,11 @@ data MemoryLevel =
750
771
| MinMemoryLevel
751
772
| MaxMemoryLevel
752
773
| MemoryLevel Int
753
- deriving (Eq , Show , Typeable , Generic )
774
+ deriving (Eq , Show , Typeable
775
+ #if __GLASGOW_HASKELL__ >= 702
776
+ , Generic
777
+ #endif
778
+ )
754
779
755
780
{-# DEPRECATED DefaultMemoryLevel "Use defaultMemoryLevel. MemoryLevel constructors will be hidden in version 0.7" #-}
756
781
{-# DEPRECATED MinMemoryLevel "Use minMemoryLevel. MemoryLevel constructors will be hidden in version 0.7" #-}
@@ -800,7 +825,11 @@ data CompressionStrategy =
800
825
DefaultStrategy
801
826
| Filtered
802
827
| HuffmanOnly
803
- deriving (Eq , Ord , Enum , Bounded , Show , Typeable , Generic )
828
+ deriving (Eq , Ord , Enum , Bounded , Show , Typeable
829
+ #if __GLASGOW_HASKELL__ >= 702
830
+ , Generic
831
+ #endif
832
+ )
804
833
805
834
{-
806
835
-- -- only available in zlib 1.2 and later, uncomment if you need it.
0 commit comments