From 456686010dd937015a9744b411870166efe27f5d Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Fri, 3 Jul 2026 00:45:27 +0200 Subject: [PATCH 1/3] Remove useless deriving Typeable --- examples/src/Twitter.hs | 10 +++++----- src/Data/Aeson/Encoding/Internal.hs | 3 +-- src/Data/Aeson/Internal/Prelude.hs | 1 - src/Data/Aeson/Key.hs | 3 +-- src/Data/Aeson/KeyMap.hs | 5 ++--- src/Data/Aeson/Types/Internal.hs | 10 +++++----- tests/Types.hs | 15 +++++++-------- 7 files changed, 21 insertions(+), 26 deletions(-) diff --git a/examples/src/Twitter.hs b/examples/src/Twitter.hs index f165900e8..a3a77ac3a 100644 --- a/examples/src/Twitter.hs +++ b/examples/src/Twitter.hs @@ -20,21 +20,21 @@ module Twitter ) where import Control.DeepSeq -import Data.Data (Typeable, Data) +import Data.Data (Data) import Data.Int (Int64) import Data.Text (Text) import GHC.Generics (Generic) newtype Metadata = Metadata { result_type :: Text - } deriving (Eq, Show, Typeable, Data, Generic) + } deriving (Eq, Show, Data, Generic) instance NFData Metadata data Geo = Geo { type_ :: Text , coordinates :: (Double, Double) - } deriving (Eq, Show, Typeable, Data, Generic) + } deriving (Eq, Show, Data, Generic) instance NFData Geo @@ -53,7 +53,7 @@ data Story = Story { , iso_language_code :: Text , to_user_id_str :: Maybe Text , source :: Text - } deriving (Show, Typeable, Data, Generic) + } deriving (Show, Data, Generic) instance NFData Story @@ -69,6 +69,6 @@ data Result = Result { , since_id_str :: Text , max_id_str :: Text , query :: Text - } deriving (Show, Typeable, Data, Generic) + } deriving (Show, Data, Generic) instance NFData Result diff --git a/src/Data/Aeson/Encoding/Internal.hs b/src/Data/Aeson/Encoding/Internal.hs index b8ce355a3..bbdf38c4e 100644 --- a/src/Data/Aeson/Encoding/Internal.hs +++ b/src/Data/Aeson/Encoding/Internal.hs @@ -82,7 +82,7 @@ import qualified Data.Text.Short as ST newtype Encoding' tag = Encoding { fromEncoding :: Builder -- ^ Acquire the underlying bytestring builder. - } deriving (Typeable) + } -- | Often used synonym for 'Encoding''. type Encoding = Encoding' Value @@ -128,7 +128,6 @@ instance IsString (Encoding' a) where -- > toEncoding (Person name age) = pairs ("name" .= name <> "age" .= age) data Series = Empty | Value (Encoding' Series) - deriving (Typeable) pair :: Key -> Encoding -> Series pair name val = pair' (key name) val diff --git a/src/Data/Aeson/Internal/Prelude.hs b/src/Data/Aeson/Internal/Prelude.hs index 1a048d026..90ea2ea3a 100644 --- a/src/Data/Aeson/Internal/Prelude.hs +++ b/src/Data/Aeson/Internal/Prelude.hs @@ -21,7 +21,6 @@ import Data.Semigroup as X (Semigroup (..)) import Data.String as X (IsString(..)) import Data.Text as X (Text) import Data.Time as X (UTCTime) -import Data.Typeable as X (Typeable) import Data.Vector as X (Vector) import Data.Void as X (Void, absurd) import Data.Word as X (Word8, Word16, Word32, Word64) diff --git a/src/Data/Aeson/Key.hs b/src/Data/Aeson/Key.hs index baba14e34..74882f6d9 100644 --- a/src/Data/Aeson/Key.hs +++ b/src/Data/Aeson/Key.hs @@ -32,7 +32,6 @@ import Data.Monoid (Monoid(mempty, mappend)) import Data.Semigroup (Semigroup((<>))) import Data.Text (Text) import Data.Type.Coercion (Coercion (..)) -import Data.Typeable (Typeable) import Text.Read (Read (..)) import qualified Data.String @@ -42,7 +41,7 @@ import qualified Language.Haskell.TH.Syntax as TH import qualified Test.QuickCheck as QC newtype Key = Key { unKey :: Text } - deriving (Typeable, Data) + deriving (Data) fromString :: String -> Key fromString = Key . T.pack diff --git a/src/Data/Aeson/KeyMap.hs b/src/Data/Aeson/KeyMap.hs index e7831b727..ac95af60b 100644 --- a/src/Data/Aeson/KeyMap.hs +++ b/src/Data/Aeson/KeyMap.hs @@ -114,7 +114,6 @@ import Data.Semigroup (Semigroup((<>))) import Data.Text (Text) import Data.These (These (..)) import Data.Type.Coercion (Coercion (..)) -import Data.Typeable (Typeable) import Text.Read (Read (..), Lexeme(..), readListPrecDefault, prec, lexP, parens) import qualified Data.Aeson.Key as Key @@ -141,7 +140,7 @@ import qualified Witherable as W -- | A map from JSON key type 'Key' to 'v'. newtype KeyMap v = KeyMap { unKeyMap :: Map Key v } - deriving (Eq, Ord, Typeable, Data, Functor) + deriving (Eq, Ord, Data, Functor) -- | Construct an empty map. @@ -355,7 +354,7 @@ import Prelude (fst) -- | A map from JSON key type 'Key' to 'v'. newtype KeyMap v = KeyMap { unKeyMap :: HashMap Key v } - deriving (Eq, Ord, Typeable, Data, Functor) + deriving (Eq, Ord, Data, Functor) -- | Construct an empty map. empty :: KeyMap v diff --git a/src/Data/Aeson/Types/Internal.hs b/src/Data/Aeson/Types/Internal.hs index 3693b8895..c7402a18b 100644 --- a/src/Data/Aeson/Types/Internal.hs +++ b/src/Data/Aeson/Types/Internal.hs @@ -112,18 +112,18 @@ data JSONPathElement = Key Key | Index {-# UNPACK #-} !Int -- ^ JSON path element of an index into an -- array, \"array[index]\". - deriving (Eq, Show, Typeable, Ord) + deriving (Eq, Show, Ord) type JSONPath = [JSONPathElement] -- | The internal result of running a 'Parser'. data IResult a = IError JSONPath String | ISuccess a - deriving (Eq, Show, Typeable) + deriving (Eq, Show) -- | The result of running a 'Parser'. data Result a = Error String | Success a - deriving (Eq, Show, Typeable) + deriving (Eq, Show) instance NFData JSONPathElement where rnf (Key t) = rnf t @@ -369,7 +369,7 @@ data Value = Object !Object | Number !Scientific | Bool !Bool | Null - deriving (Eq, Read, Typeable, Data, Generic) + deriving (Eq, Read, Data, Generic) -- | Since version 1.5.6.0 version object values are printed in lexicographic key order -- @@ -505,7 +505,7 @@ deriving instance Ord Value newtype DotNetTime = DotNetTime { fromDotNetTime :: UTCTime -- ^ Acquire the underlying value. - } deriving (Eq, Ord, Read, Show, Typeable, FormatTime) + } deriving (Eq, Ord, Read, Show, FormatTime) instance NFData Value where rnf (Object o) = rnf o diff --git a/tests/Types.hs b/tests/Types.hs index d9527491f..1d93ff8c7 100644 --- a/tests/Types.hs +++ b/tests/Types.hs @@ -41,32 +41,32 @@ data Foo = Foo { -- This definition causes an infinite loop in genericTo and genericFrom! -- , fooMap :: Map.Map String Foo , fooMap :: Map.Map String (Text,Int) - } deriving (Show, Typeable, Data) + } deriving (Show, Data) data UFoo = UFoo { _UFooInt :: Int , uFooInt :: Int - } deriving (Show, Eq, Data, Typeable) + } deriving (Show, Eq, Data) data NoConstructors data OneConstructor = OneConstructor - deriving (Show, Eq, Typeable, Data) + deriving (Show, Eq, Data) data Product2 a b = Product2 a b - deriving (Show, Eq, Typeable, Data) + deriving (Show, Eq, Data) data Product6 a b c d e f = Product6 a b c d e f - deriving (Show, Eq, Typeable, Data) + deriving (Show, Eq, Data) data Sum4 a b c d = Alt1 a | Alt2 b | Alt3 c | Alt4 d - deriving (Show, Eq, Typeable, Data) + deriving (Show, Eq, Data) class ApproxEq a where (=~) :: a -> a -> Bool newtype Approx a = Approx { fromApprox :: a } - deriving (Show, Data, Typeable, ApproxEq, Num) + deriving (Show, Data, ApproxEq, Num) instance (ApproxEq a) => Eq (Approx a) where Approx a == Approx b = a =~ b @@ -93,7 +93,6 @@ data EitherTextInt data GADT a where GADT :: { gadt :: String } -> GADT String - deriving Typeable deriving instance Data (GADT String) deriving instance Eq (GADT a) From d84d3569105c1f847c1b5b9291b0cd70d037725f Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Fri, 3 Jul 2026 00:49:05 +0200 Subject: [PATCH 2/3] test: Fix import --- tests/PropUtils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PropUtils.hs b/tests/PropUtils.hs index 19b54fe7f..268dcf917 100644 --- a/tests/PropUtils.hs +++ b/tests/PropUtils.hs @@ -31,7 +31,7 @@ import Prelude.Compat import Data.Aeson (eitherDecode, encode) import Data.Aeson.Encoding (encodingToLazyByteString) -import Data.Aeson.Types +import Data.Aeson.Types hiding (isEmptyArray) import qualified Data.Aeson.Key as Key import qualified Data.Aeson.KeyMap as KM import Data.HashMap.Strict (HashMap) From 287ca383a8c349077ab8d946599d41bed4718f18 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Fri, 3 Jul 2026 00:50:11 +0200 Subject: [PATCH 3/3] ci: Upgrade haskell-ci --- .github/workflows/haskell-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index b1603de34..f7ae3ac85 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20260331 +# version: 0.19.20260622 # -# REGENDATA ("0.19.20260331",["github","cabal.project"]) +# REGENDATA ("0.19.20260622",["github","cabal.project"]) # name: Haskell-CI on: @@ -191,7 +191,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-docspec cabal-docspec --version - name: checkout - uses: actions/checkout@v5 + uses: actions/checkout@v7 with: path: source - name: initial cabal.project for sdist @@ -282,7 +282,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@v5 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -324,7 +324,7 @@ jobs: $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson +ordered-keymap' all - name: save cache if: always() - uses: actions/cache/save@v4 + uses: actions/cache/save@v5 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store