on master help sign in
Drop pre-GHC-7.8 support (#743)
4d3767cOleg Grenrus
.travis.yml−8
@@ -65,14 +65,6 @@ matrix:
65 compiler: ": #GHC 7.8.4"
65 compiler: ": #GHC 7.8.4"
66 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
66 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
67
67
68− - env: BUILD=cabal CABALVER=1.18 GHCVER=7.6.3
69− compiler: ": #GHC 7.6.3"
70− addons: {apt: {packages: [cabal-install-1.18,ghc-7.6.3], sources: [hvr-ghc]}}
71−
72− - env: BUILD=cabal CABALVER=1.18 GHCVER=7.4.2
73− compiler: ": #GHC 7.4.2"
74− addons: {apt: {packages: [cabal-install-1.18,ghc-7.4.2], sources: [hvr-ghc]}}
75−
76before_install:
68before_install:
77 - unset CC
69 - unset CC
78 - export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
70 - export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
Data/Aeson/Compat.hsdeleted−16
@@ -1,16 +0,0 @@
1−{-# LANGUAGE CPP #-}
2−
3−module Data.Aeson.Compat
4− (
5− fromStrict
6− ) where
7−
8−import qualified Data.ByteString as S
9−import qualified Data.ByteString.Lazy as L
10−
11−fromStrict :: S.ByteString -> L.ByteString
12−#if MIN_VERSION_bytestring(0, 9, 2)
13−fromStrict = L.fromChunks . (:[])
14−#else
15−fromStrict = L.fromStrict
16−#endif
Data/Aeson/TH.hs−34
@@ -135,15 +135,8 @@ import Data.Map (Map)
135import Data.Maybe (catMaybes, fromMaybe, mapMaybe)
135import Data.Maybe (catMaybes, fromMaybe, mapMaybe)
136import qualified Data.Monoid as Monoid
136import qualified Data.Monoid as Monoid
137import Data.Set (Set)
137import Data.Set (Set)
138−#if MIN_VERSION_template_haskell(2,8,0)
139import Language.Haskell.TH hiding (Arity)
138import Language.Haskell.TH hiding (Arity)
140−#else
141−import Language.Haskell.TH
142−#endif
143import Language.Haskell.TH.Datatype
139import Language.Haskell.TH.Datatype
144−#if MIN_VERSION_template_haskell(2,7,0) && !(MIN_VERSION_template_haskell(2,8,0))
145−import Language.Haskell.TH.Lib (starK)
146−#endif
147#if MIN_VERSION_template_haskell(2,8,0) && !(MIN_VERSION_template_haskell(2,10,0))
140#if MIN_VERSION_template_haskell(2,8,0) && !(MIN_VERSION_template_haskell(2,10,0))
148import Language.Haskell.TH.Syntax (mkNameG_tc)
141import Language.Haskell.TH.Syntax (mkNameG_tc)
149#endif
142#endif
@@ -1590,21 +1583,13 @@ type TyVarMap = Map Name (Name, Name)
1590-- | Returns True if a Type has kind *.
1583-- | Returns True if a Type has kind *.
1591hasKindStar :: Type -> Bool
1584hasKindStar :: Type -> Bool
1592hasKindStar VarT{} = True
1585hasKindStar VarT{} = True
1593−#if MIN_VERSION_template_haskell(2,8,0)
1594hasKindStar (SigT _ StarT) = True
1586hasKindStar (SigT _ StarT) = True
1595−#else
1596−hasKindStar (SigT _ StarK) = True
1597−#endif
1598hasKindStar _ = False
1587hasKindStar _ = False
1599
1588
1600-- Returns True is a kind is equal to *, or if it is a kind variable.
1589-- Returns True is a kind is equal to *, or if it is a kind variable.
1601isStarOrVar :: Kind -> Bool
1590isStarOrVar :: Kind -> Bool
1602−#if MIN_VERSION_template_haskell(2,8,0)
1603isStarOrVar StarT = True
1591isStarOrVar StarT = True
1604isStarOrVar VarT{} = True
1592isStarOrVar VarT{} = True
1605−#else
1606−isStarOrVar StarK = True
1607−#endif
1608isStarOrVar _ = False
1593isStarOrVar _ = False
1609
1594
1610-- Generate a list of fresh names with a common prefix, and numbered suffixes.
1595-- Generate a list of fresh names with a common prefix, and numbered suffixes.
@@ -1662,9 +1647,7 @@ isTyFamily (ConT n) = do
1662#else
1647#else
1663 FamilyI (FamilyD TypeFam _ _ _) _ -> True
1648 FamilyI (FamilyD TypeFam _ _ _) _ -> True
1664#endif
1649#endif
1665−#if MIN_VERSION_template_haskell(2,9,0)
1666 FamilyI ClosedTypeFamilyD{} _ -> True
1650 FamilyI ClosedTypeFamilyD{} _ -> True
1667−#endif
1668 _ -> False
1651 _ -> False
1669isTyFamily _ = return False
1652isTyFamily _ = return False
1670
1653
@@ -1692,9 +1675,7 @@ mentionsName = go
1692 go :: Type -> [Name] -> Bool
1675 go :: Type -> [Name] -> Bool
1693 go (AppT t1 t2) names = go t1 names || go t2 names
1676 go (AppT t1 t2) names = go t1 names || go t2 names
1694 go (SigT t _k) names = go t names
1677 go (SigT t _k) names = go t names
1695−#if MIN_VERSION_template_haskell(2,8,0)
1696 || go _k names
1678 || go _k names
1697−#endif
1698 go (VarT n) names = n `elem` names
1679 go (VarT n) names = n `elem` names
1699 go _ _ = False
1680 go _ _ = False
1700
1681
@@ -1750,23 +1731,14 @@ uncurryTy t = ([], t :| [])
1750
1731
1751-- | Like uncurryType, except on a kind level.
1732-- | Like uncurryType, except on a kind level.
1752uncurryKind :: Kind -> NonEmpty Kind
1733uncurryKind :: Kind -> NonEmpty Kind
1753−#if MIN_VERSION_template_haskell(2,8,0)
1754uncurryKind = snd . uncurryTy
1734uncurryKind = snd . uncurryTy
1755−#else
1756−uncurryKind (ArrowK k1 k2) = k1 <| uncurryKind k2
1757−uncurryKind k = k :| []
1758−#endif
1759
1735
1760createKindChain :: Int -> Kind
1736createKindChain :: Int -> Kind
1761createKindChain = go starK
1737createKindChain = go starK
1762 where
1738 where
1763 go :: Kind -> Int -> Kind
1739 go :: Kind -> Int -> Kind
1764 go k 0 = k
1740 go k 0 = k
1765−#if MIN_VERSION_template_haskell(2,8,0)
1766 go k !n = go (AppT (AppT ArrowT StarT) k) (n - 1)
1741 go k !n = go (AppT (AppT ArrowT StarT) k) (n - 1)
1767−#else
1768− go k !n = go (ArrowK StarK k) (n - 1)
1769−#endif
1770
1742
1771-- | Makes a string literal expression from a constructor's name.
1743-- | Makes a string literal expression from a constructor's name.
1772conNameExp :: Options -> ConstructorInfo -> Q Exp
1744conNameExp :: Options -> ConstructorInfo -> Q Exp
@@ -1820,11 +1792,7 @@ canEtaReduce remaining dropped =
1820-------------------------------------------------------------------------------
1792-------------------------------------------------------------------------------
1821
1793
1822applySubstitutionKind :: Map Name Kind -> Type -> Type
1794applySubstitutionKind :: Map Name Kind -> Type -> Type
1823−#if MIN_VERSION_template_haskell(2,8,0)
1824applySubstitutionKind = applySubstitution
1795applySubstitutionKind = applySubstitution
1825−#else
1826−applySubstitutionKind _ t = t
1827−#endif
1828
1796
1829substNameWithKind :: Name -> Kind -> Type -> Type
1797substNameWithKind :: Name -> Kind -> Type -> Type
1830substNameWithKind n k = applySubstitutionKind (M.singleton n k)
1798substNameWithKind n k = applySubstitutionKind (M.singleton n k)
@@ -1988,9 +1956,7 @@ data StarKindStatus = NotKindStar
1988canRealizeKindStar :: Type -> StarKindStatus
1956canRealizeKindStar :: Type -> StarKindStatus
1989canRealizeKindStar t = case t of
1957canRealizeKindStar t = case t of
1990 _ | hasKindStar t -> KindStar
1958 _ | hasKindStar t -> KindStar
1991−#if MIN_VERSION_template_haskell(2,8,0)
1992 SigT _ (VarT k) -> IsKindVar k
1959 SigT _ (VarT k) -> IsKindVar k
1993−#endif
1994 _ -> NotKindStar
1960 _ -> NotKindStar
1995
1961
1996-- | Returns 'Just' the kind variable 'Name' of a 'StarKindStatus' if it exists.
1962-- | Returns 'Just' the kind variable 'Name' of a 'StarKindStatus' if it exists.
Data/Aeson/Types/FromJSON.hs+8−40
@@ -7,16 +7,13 @@
7{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE NoImplicitPrelude #-}
8{-# LANGUAGE NoImplicitPrelude #-}
9{-# LANGUAGE OverloadedStrings #-}
9{-# LANGUAGE OverloadedStrings #-}
10+{-# LANGUAGE PolyKinds #-}
10{-# LANGUAGE RecordWildCards #-}
11{-# LANGUAGE RecordWildCards #-}
11{-# LANGUAGE ScopedTypeVariables #-}
12{-# LANGUAGE ScopedTypeVariables #-}
12{-# LANGUAGE TypeOperators #-}
13{-# LANGUAGE TypeOperators #-}
13{-# LANGUAGE UndecidableInstances #-}
14{-# LANGUAGE UndecidableInstances #-}
14{-# LANGUAGE ViewPatterns #-}
15{-# LANGUAGE ViewPatterns #-}
15
16
16−#if __GLASGOW_HASKELL__ >= 706
17−{-# LANGUAGE PolyKinds #-}
18−#endif
19−
20#include "incoherent-compat.h"
17#include "incoherent-compat.h"
21#include "overlapping-compat.h"
18#include "overlapping-compat.h"
22
19
@@ -120,9 +117,9 @@ import GHC.Generics
120import Numeric.Natural (Natural)
117import Numeric.Natural (Natural)
121import Text.ParserCombinators.ReadP (readP_to_S)
118import Text.ParserCombinators.ReadP (readP_to_S)
122import Unsafe.Coerce (unsafeCoerce)
119import Unsafe.Coerce (unsafeCoerce)
123−import qualified Data.Aeson.Compat as Compat
124import qualified Data.Aeson.Parser.Time as Time
120import qualified Data.Aeson.Parser.Time as Time
125import qualified Data.Attoparsec.ByteString.Char8 as A (endOfInput, parseOnly, scientific)
121import qualified Data.Attoparsec.ByteString.Char8 as A (endOfInput, parseOnly, scientific)
122+import qualified Data.ByteString.Lazy as L
126import qualified Data.DList as DList
123import qualified Data.DList as DList
127import qualified Data.HashMap.Strict as H
124import qualified Data.HashMap.Strict as H
128import qualified Data.HashSet as HashSet
125import qualified Data.HashSet as HashSet
@@ -157,18 +154,8 @@ import qualified Data.Primitive.UnliftedArray as PM
157import qualified Data.Primitive.PrimArray as PM
154import qualified Data.Primitive.PrimArray as PM
158#endif
155#endif
159
156
160−#ifndef HAS_COERCIBLE
161−#define HAS_COERCIBLE (__GLASGOW_HASKELL__ >= 707)
162−#endif
163
157
164−#if HAS_COERCIBLE
165import Data.Coerce (Coercible, coerce)
158import Data.Coerce (Coercible, coerce)
166−coerce' :: Coercible a b => a -> b
167−coerce' = coerce
168−#else
169−coerce' :: a -> b
170−coerce' = unsafeCoerce
171−#endif
172
159
173parseIndexedJSON :: (Value -> Parser a) -> Int -> Value -> Parser a
160parseIndexedJSON :: (Value -> Parser a) -> Int -> Value -> Parser a
174parseIndexedJSON p idx value = p value <?> Index idx
161parseIndexedJSON p idx value = p value <?> Index idx
@@ -440,11 +427,7 @@ class FromJSONKey a where
440-- At the moment this type is intentionally not exported. 'FromJSONKeyFunction'
427-- At the moment this type is intentionally not exported. 'FromJSONKeyFunction'
441-- can be inspected, but cannot be constructed.
428-- can be inspected, but cannot be constructed.
442data CoerceText a where
429data CoerceText a where
443−#if HAS_COERCIBLE
444 CoerceText :: Coercible Text a => CoerceText a
430 CoerceText :: Coercible Text a => CoerceText a
445−#else
446− CoerceText :: CoerceText a
447−#endif
448
431
449-- | This type is related to 'ToJSONKeyFunction'. If 'FromJSONKeyValue' is used in the
432-- | This type is related to 'ToJSONKeyFunction'. If 'FromJSONKeyValue' is used in the
450-- 'FromJSONKey' instance, then 'ToJSONKeyValue' should be used in the 'ToJSONKey'
433-- 'FromJSONKey' instance, then 'ToJSONKeyValue' should be used in the 'ToJSONKey'
@@ -464,7 +447,7 @@ data FromJSONKeyFunction a
464
447
465-- | Only law abiding up to interpretation
448-- | Only law abiding up to interpretation
466instance Functor FromJSONKeyFunction where
449instance Functor FromJSONKeyFunction where
467− fmap h (FromJSONKeyCoerce CoerceText) = FromJSONKeyText (h . coerce')
450+ fmap h (FromJSONKeyCoerce CoerceText) = FromJSONKeyText (h . coerce)
468 fmap h (FromJSONKeyText f) = FromJSONKeyText (h . f)
451 fmap h (FromJSONKeyText f) = FromJSONKeyText (h . f)
469 fmap h (FromJSONKeyTextParser f) = FromJSONKeyTextParser (fmap h . f)
452 fmap h (FromJSONKeyTextParser f) = FromJSONKeyTextParser (fmap h . f)
470 fmap h (FromJSONKeyValue f) = FromJSONKeyValue (fmap h . f)
453 fmap h (FromJSONKeyValue f) = FromJSONKeyValue (fmap h . f)
@@ -478,9 +461,7 @@ instance Functor FromJSONKeyFunction where
478--
461--
479-- On pre GHC 7.8 this is unconstrainted function.
462-- On pre GHC 7.8 this is unconstrainted function.
480fromJSONKeyCoerce ::
463fromJSONKeyCoerce ::
481−#if HAS_COERCIBLE
482 Coercible Text a =>
464 Coercible Text a =>
483−#endif
484 FromJSONKeyFunction a
465 FromJSONKeyFunction a
485fromJSONKeyCoerce = FromJSONKeyCoerce CoerceText
466fromJSONKeyCoerce = FromJSONKeyCoerce CoerceText
486
467
@@ -488,29 +469,18 @@ fromJSONKeyCoerce = FromJSONKeyCoerce CoerceText
488--
469--
489-- See note on 'fromJSONKeyCoerce'.
470-- See note on 'fromJSONKeyCoerce'.
490coerceFromJSONKeyFunction ::
471coerceFromJSONKeyFunction ::
491−#if HAS_COERCIBLE
492 Coercible a b =>
472 Coercible a b =>
493−#endif
494 FromJSONKeyFunction a -> FromJSONKeyFunction b
473 FromJSONKeyFunction a -> FromJSONKeyFunction b
495−#if HAS_COERCIBLE
496coerceFromJSONKeyFunction = coerce
474coerceFromJSONKeyFunction = coerce
497−#else
498−coerceFromJSONKeyFunction (FromJSONKeyCoerce CoerceText) = FromJSONKeyCoerce CoerceText
499−coerceFromJSONKeyFunction (FromJSONKeyText f) = FromJSONKeyText (coerce' . f)
500−coerceFromJSONKeyFunction (FromJSONKeyTextParser f) = FromJSONKeyTextParser (fmap coerce' . f)
501−coerceFromJSONKeyFunction (FromJSONKeyValue f) = FromJSONKeyValue (fmap coerce' . f)
502−#endif
503
475
504{-# RULES
476{-# RULES
505 "FromJSONKeyCoerce: fmap id" forall (x :: FromJSONKeyFunction a).
477 "FromJSONKeyCoerce: fmap id" forall (x :: FromJSONKeyFunction a).
506 fmap id x = x
478 fmap id x = x
507 #-}
479 #-}
508−#if HAS_COERCIBLE
509{-# RULES
480{-# RULES
510 "FromJSONKeyCoerce: fmap coerce" forall x .
481 "FromJSONKeyCoerce: fmap coerce" forall x .
511 fmap coerce x = coerceFromJSONKeyFunction x
482 fmap coerce x = coerceFromJSONKeyFunction x
512 #-}
483 #-}
513−#endif
514
484
515-- | Same as 'fmap'. Provided for the consistency with 'ToJSONKeyFunction'.
485-- | Same as 'fmap'. Provided for the consistency with 'ToJSONKeyFunction'.
516mapFromJSONKeyFunction :: (a -> b) -> FromJSONKeyFunction a -> FromJSONKeyFunction b
486mapFromJSONKeyFunction :: (a -> b) -> FromJSONKeyFunction a -> FromJSONKeyFunction b
@@ -797,13 +767,13 @@ withBoundedScientific' f v = withBoundedScientific_ id f v
797-- | A variant of 'withBoundedScientific_' parameterized by a function to apply
767-- | A variant of 'withBoundedScientific_' parameterized by a function to apply
798-- to the 'Parser' in case of failure.
768-- to the 'Parser' in case of failure.
799withBoundedScientific_ :: (Parser a -> Parser a) -> (Scientific -> Parser a) -> Value -> Parser a
769withBoundedScientific_ :: (Parser a -> Parser a) -> (Scientific -> Parser a) -> Value -> Parser a
800−withBoundedScientific_ whenFail f v@(Number scientific) =
770+withBoundedScientific_ whenFail f (Number scientific) =
801− if exponent > 1024
771+ if exp10 > 1024
802 then whenFail (fail msg)
772 then whenFail (fail msg)
803 else f scientific
773 else f scientific
804 where
774 where
805− exponent = base10Exponent scientific
775+ exp10 = base10Exponent scientific
806− msg = "found a number with exponent " ++ show exponent ++ ", but it must not be greater than 1024"
776+ msg = "found a number with exponent " ++ show exp10 ++ ", but it must not be greater than 1024"
807withBoundedScientific_ whenFail _ v =
777withBoundedScientific_ whenFail _ v =
808 whenFail (typeMismatch "Number" v)
778 whenFail (typeMismatch "Number" v)
809{-# INLINE withBoundedScientific_ #-}
779{-# INLINE withBoundedScientific_ #-}
@@ -823,7 +793,7 @@ withBool name _ v = prependContext name (typeMismatch "Boolean" v)
823-- | Decode a nested JSON-encoded string.
793-- | Decode a nested JSON-encoded string.
824withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a
794withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a
825withEmbeddedJSON _ innerParser (String txt) =
795withEmbeddedJSON _ innerParser (String txt) =
826− either fail innerParser $ eitherDecode (Compat.fromStrict $ T.encodeUtf8 txt)
796+ either fail innerParser $ eitherDecode (L.fromStrict $ T.encodeUtf8 txt)
827 where
797 where
828 eitherDecode = eitherFormatError . eitherDecodeWith jsonEOF ifromJSON
798 eitherDecode = eitherFormatError . eitherDecodeWith jsonEOF ifromJSON
829 eitherFormatError = either (Left . uncurry formatError) Right
799 eitherFormatError = either (Left . uncurry formatError) Right
@@ -1991,7 +1961,6 @@ instance FromJSON DotNetTime where
1991-- primitive
1961-- primitive
1992-------------------------------------------------------------------------------
1962-------------------------------------------------------------------------------
1993
1963
1994−#if MIN_VERSION_base(4,7,0)
1995instance FromJSON a => FromJSON (PM.Array a) where
1964instance FromJSON a => FromJSON (PM.Array a) where
1996 -- note: we could do better than this if vector exposed the data
1965 -- note: we could do better than this if vector exposed the data
1997 -- constructor in Data.Vector.
1966 -- constructor in Data.Vector.
@@ -2009,7 +1978,6 @@ instance (PM.PrimUnlifted a,FromJSON a) => FromJSON (PM.UnliftedArray a) where
2009 parseJSON = fmap Exts.fromList . parseJSON
1978 parseJSON = fmap Exts.fromList . parseJSON
2010#endif
1979#endif
2011#endif
1980#endif
2012−#endif
2013
1981
2014-------------------------------------------------------------------------------
1982-------------------------------------------------------------------------------
2015-- time
1983-- time
Data/Aeson/Types/ToJSON.hs+3−41
@@ -8,15 +8,12 @@
8{-# LANGUAGE NoImplicitPrelude #-}
8{-# LANGUAGE NoImplicitPrelude #-}
9{-# LANGUAGE OverloadedStrings #-}
9{-# LANGUAGE OverloadedStrings #-}
10{-# LANGUAGE PatternGuards #-}
10{-# LANGUAGE PatternGuards #-}
11+{-# LANGUAGE PolyKinds #-}
11{-# LANGUAGE RecordWildCards #-}
12{-# LANGUAGE RecordWildCards #-}
12{-# LANGUAGE ScopedTypeVariables #-}
13{-# LANGUAGE ScopedTypeVariables #-}
13{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE TypeOperators #-}
14{-# LANGUAGE UndecidableInstances #-}
15{-# LANGUAGE UndecidableInstances #-}
15
16
16−#if __GLASGOW_HASKELL__ >= 706
17−{-# LANGUAGE PolyKinds #-}
18−#endif
19−
20#include "overlapping-compat.h"
17#include "overlapping-compat.h"
21#include "incoherent-compat.h"
18#include "incoherent-compat.h"
22
19
@@ -144,14 +141,6 @@ import qualified Data.Primitive.UnliftedArray as PM
144import qualified Data.Primitive.PrimArray as PM
141import qualified Data.Primitive.PrimArray as PM
145#endif
142#endif
146
143
147−#if !(MIN_VERSION_bytestring(0,10,0))
148−import Foreign.ForeignPtr (withForeignPtr)
149−import Foreign.Marshal.Utils (copyBytes)
150−import Foreign.Ptr (plusPtr)
151−import qualified Data.ByteString.Internal as S
152−import qualified Data.ByteString.Lazy.Internal as L
153−#endif
154−
155toJSONPair :: (a -> Value) -> (b -> Value) -> (a, b) -> Value
144toJSONPair :: (a -> Value) -> (b -> Value) -> (a, b) -> Value
156toJSONPair a b = liftToJSON2 a (listValue a) b (listValue b)
145toJSONPair a b = liftToJSON2 a (listValue a) b (listValue b)
157{-# INLINE toJSONPair #-}
146{-# INLINE toJSONPair #-}
@@ -515,7 +504,7 @@ toJSONKeyTextEnc e = ToJSONKeyText tot e
515 -- TODO: dropAround is also used in stringEncoding, which is unfortunate atm
504 -- TODO: dropAround is also used in stringEncoding, which is unfortunate atm
516 tot = T.dropAround (== '"')
505 tot = T.dropAround (== '"')
517 . T.decodeLatin1
506 . T.decodeLatin1
518− . lazyToStrictByteString
507+ . L.toStrict
519 . E.encodingToLazyByteString
508 . E.encodingToLazyByteString
520 . e
509 . e
521
510
@@ -1982,7 +1971,6 @@ formatMillis = take 3 . formatTime defaultTimeLocale "%q"
1982-- primitive
1971-- primitive
1983-------------------------------------------------------------------------------
1972-------------------------------------------------------------------------------
1984
1973
1985−#if MIN_VERSION_base(4,7,0)
1986instance ToJSON a => ToJSON (PM.Array a) where
1974instance ToJSON a => ToJSON (PM.Array a) where
1987 -- note: we could do better than this if vector exposed the data
1975 -- note: we could do better than this if vector exposed the data
1988 -- constructor in Data.Vector.
1976 -- constructor in Data.Vector.
@@ -2004,7 +1992,6 @@ instance (PM.PrimUnlifted a,ToJSON a) => ToJSON (PM.UnliftedArray a) where
2004 toEncoding = toEncoding . Exts.toList
1992 toEncoding = toEncoding . Exts.toList
2005#endif
1993#endif
2006#endif
1994#endif
2007−#endif
2008
1995
2009-------------------------------------------------------------------------------
1996-------------------------------------------------------------------------------
2010-- time
1997-- time
@@ -2054,7 +2041,7 @@ stringEncoding :: Encoding' Text -> Value
2054stringEncoding = String
2041stringEncoding = String
2055 . T.dropAround (== '"')
2042 . T.dropAround (== '"')
2056 . T.decodeLatin1
2043 . T.decodeLatin1
2057− . lazyToStrictByteString
2044+ . L.toStrict
2058 . E.encodingToLazyByteString
2045 . E.encodingToLazyByteString
2059{-# INLINE stringEncoding #-}
2046{-# INLINE stringEncoding #-}
2060
2047
@@ -2861,31 +2848,6 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2861 toEncoding = toEncoding2
2848 toEncoding = toEncoding2
2862 {-# INLINE toEncoding #-}
2849 {-# INLINE toEncoding #-}
2863
2850
2864−-------------------------------------------------------------------------------
2865−-- pre-bytestring-0.10 compatibility
2866−-------------------------------------------------------------------------------
2867−
2868−{-# INLINE lazyToStrictByteString #-}
2869−lazyToStrictByteString :: L.ByteString -> S.ByteString
2870−#if MIN_VERSION_bytestring(0,10,0)
2871−lazyToStrictByteString = L.toStrict
2872−#else
2873−lazyToStrictByteString = packChunks
2874−
2875−-- packChunks is taken from the blaze-builder package.
2876−
2877−-- | Pack the chunks of a lazy bytestring into a single strict bytestring.
2878−packChunks :: L.ByteString -> S.ByteString
2879−packChunks lbs =
2880− S.unsafeCreate (fromIntegral $ L.length lbs) (copyChunks lbs)
2881− where
2882− copyChunks L.Empty _pf = return ()
2883− copyChunks (L.Chunk (S.PS fpbuf o l) lbs') pf = do
2884− withForeignPtr fpbuf $ \pbuf ->
2885− copyBytes pf (pbuf `plusPtr` o) l
2886− copyChunks lbs' (pf `plusPtr` l)
2887−#endif
2888−
2889--------------------------------------------------------------------------------
2851--------------------------------------------------------------------------------
2890
2852
2891-- | Wrap a list of pairs as an object.
2853-- | Wrap a list of pairs as an object.
aeson.cabal+4−10
@@ -88,7 +88,6 @@ library
88 Data.Aeson.Encode
88 Data.Aeson.Encode
89
89
90 other-modules:
90 other-modules:
91− Data.Aeson.Compat
92 Data.Aeson.Encoding.Builder
91 Data.Aeson.Encoding.Builder
93 Data.Aeson.Internal.Functions
92 Data.Aeson.Internal.Functions
94 Data.Aeson.Parser.Unescape
93 Data.Aeson.Parser.Unescape
@@ -103,11 +102,12 @@ library
103
102
104 -- GHC bundled libs
103 -- GHC bundled libs
105 build-depends:
104 build-depends:
106− base >= 4.5.0.0 && < 5,
105+ base >= 4.7.0.0 && < 5,
106+ bytestring >= 0.10.4.0 && < 0.11,
107− containers >= 0.4.2.1 && < 0.7,
107+ containers >= 0.5.5.1 && < 0.7,
108 deepseq >= 1.3.0.0 && < 1.5,
108 deepseq >= 1.3.0.0 && < 1.5,
109 ghc-prim >= 0.2 && < 0.6,
109 ghc-prim >= 0.2 && < 0.6,
110− template-haskell >= 2.7.0.0 && < 2.16,
110+ template-haskell >= 2.9.0.0 && < 2.16,
111 text >= 1.2.3.0 && < 1.3,
111 text >= 1.2.3.0 && < 1.3,
112 time >= 1.4 && < 1.10
112 time >= 1.4 && < 1.10
113
113
@@ -119,12 +119,6 @@ library
119 base-compat >= 0.9.1 && < 0.12,
119 base-compat >= 0.9.1 && < 0.12,
120 time-compat >= 1.9.2.2 && < 1.10
120 time-compat >= 1.9.2.2 && < 1.10
121
121
122− if flag(bytestring-builder)
123− build-depends: bytestring >= 0.9.2.1 && < 0.10.4,
124− bytestring-builder >= 0.10.4 && < 1
125− else
126− build-depends: bytestring >= 0.10.4 && < 0.11
127−
128 if !impl(ghc >= 8.6)
122 if !impl(ghc >= 8.6)
129 build-depends:
123 build-depends:
130 contravariant >=1.4.1 && <1.6
124 contravariant >=1.4.1 && <1.6
attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs−20
@@ -29,16 +29,8 @@ import Data.Time.Clock (diffTimeToPicoseconds)
29
29
30#endif
30#endif
31
31
32−#if MIN_VERSION_base(4,7,0)
33−
34import Data.Fixed (Pico, Fixed(MkFixed))
32import Data.Fixed (Pico, Fixed(MkFixed))
35
33
36−#else
37−
38−import Data.Fixed (Pico)
39−
40−#endif
41−
42#if !MIN_VERSION_time(1,6,0)
34#if !MIN_VERSION_time(1,6,0)
43
35
44diffTimeToPicoseconds :: DiffTime -> Integer
36diffTimeToPicoseconds :: DiffTime -> Integer
@@ -46,24 +38,12 @@ diffTimeToPicoseconds = unsafeCoerce
46
38
47#endif
39#endif
48
40
49−#if MIN_VERSION_base(4,7,0)
50−
51toPico :: Integer -> Pico
41toPico :: Integer -> Pico
52toPico = MkFixed
42toPico = MkFixed
53
43
54fromPico :: Pico -> Integer
44fromPico :: Pico -> Integer
55fromPico (MkFixed i) = i
45fromPico (MkFixed i) = i
56
46
57−#else
58−
59−toPico :: Integer -> Pico
60−toPico = unsafeCoerce
61−
62−fromPico :: Pico -> Integer
63−fromPico = unsafeCoerce
64−
65−#endif
66−
67-- | Like TimeOfDay, but using a fixed-width integer for seconds.
47-- | Like TimeOfDay, but using a fixed-width integer for seconds.
68data TimeOfDay64 = TOD {-# UNPACK #-} !Int
48data TimeOfDay64 = TOD {-# UNPACK #-} !Int
69 {-# UNPACK #-} !Int
49 {-# UNPACK #-} !Int
attoparsec-iso8601/attoparsec-iso8601.cabal+1−1
@@ -36,7 +36,7 @@ library
36 Data.Attoparsec.Time
36 Data.Attoparsec.Time
37 build-depends:
37 build-depends:
38 attoparsec >= 0.13.0.1,
38 attoparsec >= 0.13.0.1,
39− base >= 4.5 && < 5,
39+ base >= 4.7 && < 5,
40 base-compat >= 0.9.1 && < 0.12,
40 base-compat >= 0.9.1 && < 0.12,
41 text >= 1.1.1.0,
41 text >= 1.1.1.0,
42 time >= 1.1.1.4
42 time >= 1.1.1.4
benchmarks/aeson-benchmarks.cabal−1
@@ -72,7 +72,6 @@ library
72
72
73 exposed-modules:
73 exposed-modules:
74 Data.Aeson
74 Data.Aeson
75− Data.Aeson.Compat
76 Data.Aeson.Encoding
75 Data.Aeson.Encoding
77 Data.Aeson.Encoding.Builder
76 Data.Aeson.Encoding.Builder
78 Data.Aeson.Encoding.Internal
77 Data.Aeson.Encoding.Internal
cabal.project+1
@@ -2,3 +2,4 @@ with-compiler: ghc
2packages: .
2packages: .
3packages: attoparsec-iso8601
3packages: attoparsec-iso8601
4-- packages: benchmarks
4-- packages: benchmarks
5+tests: true
tests/Encoders.hs−6
@@ -188,7 +188,6 @@ gSomeTypeToEncoding2ElemArray = genericToEncoding opts2ElemArray
188gSomeTypeParseJSON2ElemArray :: Value -> Parser (SomeType Int)
188gSomeTypeParseJSON2ElemArray :: Value -> Parser (SomeType Int)
189gSomeTypeParseJSON2ElemArray = genericParseJSON opts2ElemArray
189gSomeTypeParseJSON2ElemArray = genericParseJSON opts2ElemArray
190
190
191−#if __GLASGOW_HASKELL__ >= 706
192gSomeTypeLiftToEncoding2ElemArray :: LiftToEncoding SomeType a
191gSomeTypeLiftToEncoding2ElemArray :: LiftToEncoding SomeType a
193gSomeTypeLiftToEncoding2ElemArray = genericLiftToEncoding opts2ElemArray
192gSomeTypeLiftToEncoding2ElemArray = genericLiftToEncoding opts2ElemArray
194
193
@@ -197,7 +196,6 @@ gSomeTypeLiftToJSON2ElemArray = genericLiftToJSON opts2ElemArray
197
196
198gSomeTypeLiftParseJSON2ElemArray :: LiftParseJSON SomeType a
197gSomeTypeLiftParseJSON2ElemArray :: LiftParseJSON SomeType a
199gSomeTypeLiftParseJSON2ElemArray = genericLiftParseJSON opts2ElemArray
198gSomeTypeLiftParseJSON2ElemArray = genericLiftParseJSON opts2ElemArray
200−#endif
201
199
202
200
203gSomeTypeToJSONTaggedObject :: SomeType Int -> Value
201gSomeTypeToJSONTaggedObject :: SomeType Int -> Value
@@ -209,7 +207,6 @@ gSomeTypeToEncodingTaggedObject = genericToEncoding optsTaggedObject
209gSomeTypeParseJSONTaggedObject :: Value -> Parser (SomeType Int)
207gSomeTypeParseJSONTaggedObject :: Value -> Parser (SomeType Int)
210gSomeTypeParseJSONTaggedObject = genericParseJSON optsTaggedObject
208gSomeTypeParseJSONTaggedObject = genericParseJSON optsTaggedObject
211
209
212−#if __GLASGOW_HASKELL__ >= 706
213gSomeTypeLiftToEncodingTaggedObject :: LiftToEncoding SomeType a
210gSomeTypeLiftToEncodingTaggedObject :: LiftToEncoding SomeType a
214gSomeTypeLiftToEncodingTaggedObject = genericLiftToEncoding optsTaggedObject
211gSomeTypeLiftToEncodingTaggedObject = genericLiftToEncoding optsTaggedObject
215
212
@@ -218,7 +215,6 @@ gSomeTypeLiftToJSONTaggedObject = genericLiftToJSON optsTaggedObject
218
215
219gSomeTypeLiftParseJSONTaggedObject :: LiftParseJSON SomeType a
216gSomeTypeLiftParseJSONTaggedObject :: LiftParseJSON SomeType a
220gSomeTypeLiftParseJSONTaggedObject = genericLiftParseJSON optsTaggedObject
217gSomeTypeLiftParseJSONTaggedObject = genericLiftParseJSON optsTaggedObject
221−#endif
222
218
223
219
224gSomeTypeToJSONObjectWithSingleField :: SomeType Int -> Value
220gSomeTypeToJSONObjectWithSingleField :: SomeType Int -> Value
@@ -230,7 +226,6 @@ gSomeTypeToEncodingObjectWithSingleField = genericToEncoding optsObjectWithSingl
230gSomeTypeParseJSONObjectWithSingleField :: Value -> Parser (SomeType Int)
226gSomeTypeParseJSONObjectWithSingleField :: Value -> Parser (SomeType Int)
231gSomeTypeParseJSONObjectWithSingleField = genericParseJSON optsObjectWithSingleField
227gSomeTypeParseJSONObjectWithSingleField = genericParseJSON optsObjectWithSingleField
232
228
233−#if __GLASGOW_HASKELL__ >= 706
234gSomeTypeLiftToEncodingObjectWithSingleField :: LiftToEncoding SomeType a
229gSomeTypeLiftToEncodingObjectWithSingleField :: LiftToEncoding SomeType a
235gSomeTypeLiftToEncodingObjectWithSingleField = genericLiftToEncoding optsObjectWithSingleField
230gSomeTypeLiftToEncodingObjectWithSingleField = genericLiftToEncoding optsObjectWithSingleField
236
231
@@ -239,7 +234,6 @@ gSomeTypeLiftToJSONObjectWithSingleField = genericLiftToJSON optsObjectWithSingl
239
234
240gSomeTypeLiftParseJSONObjectWithSingleField :: LiftParseJSON SomeType a
235gSomeTypeLiftParseJSONObjectWithSingleField :: LiftParseJSON SomeType a
241gSomeTypeLiftParseJSONObjectWithSingleField = genericLiftParseJSON optsObjectWithSingleField
236gSomeTypeLiftParseJSONObjectWithSingleField = genericLiftParseJSON optsObjectWithSingleField
242−#endif
243
237
244
238
245gSomeTypeToJSONOmitNothingFields :: SomeType Int -> Value
239gSomeTypeToJSONOmitNothingFields :: SomeType Int -> Value
tests/Instances.hs−3
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE NoImplicitPrelude #-}
@@ -25,9 +24,7 @@ import qualified Data.HashMap.Strict as HM
25
24
26import Data.Orphans ()
25import Data.Orphans ()
27import Test.QuickCheck.Instances ()
26import Test.QuickCheck.Instances ()
28−#if MIN_VERSION_base(4,7,0)
29import Data.Hashable.Time ()
27import Data.Hashable.Time ()
30−#endif
31
28
32-- "System" types.
29-- "System" types.
33
30
tests/PropertyGeneric.hs−8
@@ -44,11 +44,9 @@ genericTests =
44 , testProperty "TaggedObject" (toParseJSON gSomeTypeParseJSONTaggedObject gSomeTypeToJSONTaggedObject)
44 , testProperty "TaggedObject" (toParseJSON gSomeTypeParseJSONTaggedObject gSomeTypeToJSONTaggedObject)
45 , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField gSomeTypeToJSONObjectWithSingleField)
45 , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField gSomeTypeToJSONObjectWithSingleField)
46
46
47−#if __GLASGOW_HASKELL__ >= 706
48 , testProperty "2ElemArray unary" (toParseJSON1 gSomeTypeLiftParseJSON2ElemArray gSomeTypeLiftToJSON2ElemArray)
47 , testProperty "2ElemArray unary" (toParseJSON1 gSomeTypeLiftParseJSON2ElemArray gSomeTypeLiftToJSON2ElemArray)
49 , testProperty "TaggedObject unary" (toParseJSON1 gSomeTypeLiftParseJSONTaggedObject gSomeTypeLiftToJSONTaggedObject)
48 , testProperty "TaggedObject unary" (toParseJSON1 gSomeTypeLiftParseJSONTaggedObject gSomeTypeLiftToJSONTaggedObject)
50 , testProperty "ObjectWithSingleField unary" (toParseJSON1 gSomeTypeLiftParseJSONObjectWithSingleField gSomeTypeLiftToJSONObjectWithSingleField)
49 , testProperty "ObjectWithSingleField unary" (toParseJSON1 gSomeTypeLiftParseJSONObjectWithSingleField gSomeTypeLiftToJSONObjectWithSingleField)
51−#endif
52 ]
50 ]
53 ]
51 ]
54 , testGroup "OneConstructor" [
52 , testGroup "OneConstructor" [
@@ -85,30 +83,24 @@ genericTests =
85
83
86 , testProperty "SomeType2ElemArray" $
84 , testProperty "SomeType2ElemArray" $
87 gSomeTypeToJSON2ElemArray `sameAs` gSomeTypeToEncoding2ElemArray
85 gSomeTypeToJSON2ElemArray `sameAs` gSomeTypeToEncoding2ElemArray
88−#if __GLASGOW_HASKELL__ >= 706
89 , testProperty "SomeType2ElemArray unary" $
86 , testProperty "SomeType2ElemArray unary" $
90 gSomeTypeLiftToJSON2ElemArray `sameAs1` gSomeTypeLiftToEncoding2ElemArray
87 gSomeTypeLiftToJSON2ElemArray `sameAs1` gSomeTypeLiftToEncoding2ElemArray
91 , testProperty "SomeType2ElemArray unary agree" $
88 , testProperty "SomeType2ElemArray unary agree" $
92 gSomeTypeToEncoding2ElemArray `sameAs1Agree` gSomeTypeLiftToEncoding2ElemArray
89 gSomeTypeToEncoding2ElemArray `sameAs1Agree` gSomeTypeLiftToEncoding2ElemArray
93−#endif
94
90
95 , testProperty "SomeTypeTaggedObject" $
91 , testProperty "SomeTypeTaggedObject" $
96 gSomeTypeToJSONTaggedObject `sameAs` gSomeTypeToEncodingTaggedObject
92 gSomeTypeToJSONTaggedObject `sameAs` gSomeTypeToEncodingTaggedObject
97−#if __GLASGOW_HASKELL__ >= 706
98 , testProperty "SomeTypeTaggedObject unary" $
93 , testProperty "SomeTypeTaggedObject unary" $
99 gSomeTypeLiftToJSONTaggedObject `sameAs1` gSomeTypeLiftToEncodingTaggedObject
94 gSomeTypeLiftToJSONTaggedObject `sameAs1` gSomeTypeLiftToEncodingTaggedObject
100 , testProperty "SomeTypeTaggedObject unary agree" $
95 , testProperty "SomeTypeTaggedObject unary agree" $
101 gSomeTypeToEncodingTaggedObject `sameAs1Agree` gSomeTypeLiftToEncodingTaggedObject
96 gSomeTypeToEncodingTaggedObject `sameAs1Agree` gSomeTypeLiftToEncodingTaggedObject
102−#endif
103
97
104 , testProperty "SomeTypeObjectWithSingleField" $
98 , testProperty "SomeTypeObjectWithSingleField" $
105 gSomeTypeToJSONObjectWithSingleField `sameAs` gSomeTypeToEncodingObjectWithSingleField
99 gSomeTypeToJSONObjectWithSingleField `sameAs` gSomeTypeToEncodingObjectWithSingleField
106−#if __GLASGOW_HASKELL__ >= 706
107 , testProperty "SomeTypeObjectWithSingleField unary" $
100 , testProperty "SomeTypeObjectWithSingleField unary" $
108 gSomeTypeLiftToJSONObjectWithSingleField `sameAs1` gSomeTypeLiftToEncodingObjectWithSingleField
101 gSomeTypeLiftToJSONObjectWithSingleField `sameAs1` gSomeTypeLiftToEncodingObjectWithSingleField
109 , testProperty "SomeTypeObjectWithSingleField unary agree" $
102 , testProperty "SomeTypeObjectWithSingleField unary agree" $
110 gSomeTypeToEncodingObjectWithSingleField `sameAs1Agree` gSomeTypeLiftToEncodingObjectWithSingleField
103 gSomeTypeToEncodingObjectWithSingleField `sameAs1Agree` gSomeTypeLiftToEncodingObjectWithSingleField
111−#endif
112
104
113 , testProperty "SomeTypeOmitNothingFields" $
105 , testProperty "SomeTypeOmitNothingFields" $
114 gSomeTypeToJSONOmitNothingFields `sameAs` gSomeTypeToEncodingOmitNothingFields
106 gSomeTypeToJSONOmitNothingFields `sameAs` gSomeTypeToEncodingOmitNothingFields
tests/PropertyKeys.hs−3
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE NoImplicitPrelude #-}
1{-# LANGUAGE NoImplicitPrelude #-}
3
2
4module PropertyKeys ( keysTests ) where
3module PropertyKeys ( keysTests ) where
@@ -31,12 +30,10 @@ keysTests =
31 , testProperty "Natural" $ roundTripKey (undefined :: Natural)
30 , testProperty "Natural" $ roundTripKey (undefined :: Natural)
32 , testProperty "Float" $ roundTripKey (undefined :: Float)
31 , testProperty "Float" $ roundTripKey (undefined :: Float)
33 , testProperty "Double" $ roundTripKey (undefined :: Double)
32 , testProperty "Double" $ roundTripKey (undefined :: Double)
34−#if MIN_VERSION_base(4,7,0)
35 , testProperty "Day" $ roundTripKey (undefined :: Day)
33 , testProperty "Day" $ roundTripKey (undefined :: Day)
36 , testProperty "LocalTime" $ roundTripKey (undefined :: LocalTime)
34 , testProperty "LocalTime" $ roundTripKey (undefined :: LocalTime)
37 , testProperty "TimeOfDay" $ roundTripKey (undefined :: TimeOfDay)
35 , testProperty "TimeOfDay" $ roundTripKey (undefined :: TimeOfDay)
38 , testProperty "UTCTime" $ roundTripKey (undefined :: UTCTime)
36 , testProperty "UTCTime" $ roundTripKey (undefined :: UTCTime)
39−#endif
40 , testProperty "Version" $ roundTripKey (undefined :: Version)
37 , testProperty "Version" $ roundTripKey (undefined :: Version)
41 , testProperty "Lazy Text" $ roundTripKey (undefined :: LT.Text)
38 , testProperty "Lazy Text" $ roundTripKey (undefined :: LT.Text)
42 , testProperty "UUID" $ roundTripKey UUID.nil
39 , testProperty "UUID" $ roundTripKey UUID.nil
tests/SerializationFormatSpec.hs−4
@@ -3,9 +3,7 @@
3{-# LANGUAGE GADTs #-}
3{-# LANGUAGE GADTs #-}
4{-# LANGUAGE NoImplicitPrelude #-}
4{-# LANGUAGE NoImplicitPrelude #-}
5{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE OverloadedStrings #-}
6−#if __GLASGOW_HASKELL__ >= 708
7{-# LANGUAGE DataKinds #-}
6{-# LANGUAGE DataKinds #-}
8−#endif
9
7
10------------------------------------------------------------------------------
8------------------------------------------------------------------------------
11-- These tests assert that the JSON serialization doesn't change by accident.
9-- These tests assert that the JSON serialization doesn't change by accident.
@@ -77,10 +75,8 @@ jsonExamples =
77 , example "Just" "1" (Just 1 :: Maybe Int)
75 , example "Just" "1" (Just 1 :: Maybe Int)
78 , example "Proxy Int" "null" (Proxy :: Proxy Int)
76 , example "Proxy Int" "null" (Proxy :: Proxy Int)
79 , example "Tagged Char Int" "1" (Tagged 1 :: Tagged Char Int)
77 , example "Tagged Char Int" "1" (Tagged 1 :: Tagged Char Int)
80−#if __GLASGOW_HASKELL__ >= 708
81 -- Test Tagged instance is polykinded
78 -- Test Tagged instance is polykinded
82 , example "Tagged 123 Int" "1" (Tagged 1 :: Tagged 123 Int)
79 , example "Tagged 123 Int" "1" (Tagged 1 :: Tagged 123 Int)
83−#endif
84 , example "Const Char Int" "\"c\"" (Const 'c' :: Const Char Int)
80 , example "Const Char Int" "\"c\"" (Const 'c' :: Const Char Int)
85 , example "Tuple" "[1,2]" ((1, 2) :: (Int, Int))
81 , example "Tuple" "[1,2]" ((1, 2) :: (Int, Int))
86 , example "NonEmpty" "[1,2,3]" (1 :| [2, 3] :: NonEmpty Int)
82 , example "NonEmpty" "[1,2,3]" (1 :| [2, 3] :: NonEmpty Int)
tests/Types.hs−2
@@ -119,9 +119,7 @@ deriving instance Generic (Sum4 a b c d)
119deriving instance Generic (Approx a)
119deriving instance Generic (Approx a)
120deriving instance Generic Nullary
120deriving instance Generic Nullary
121deriving instance Generic (SomeType a)
121deriving instance Generic (SomeType a)
122−#if __GLASGOW_HASKELL__ >= 706
123deriving instance Generic1 SomeType
122deriving instance Generic1 SomeType
124−#endif
125deriving instance Generic OptionField
123deriving instance Generic OptionField
126deriving instance Generic EitherTextInt
124deriving instance Generic EitherTextInt
127
125