From e10681c29a0f11f7b6a5a5b74cfc1ea4a6e6e33d Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Mon, 5 Jan 2026 00:14:18 -0600 Subject: [PATCH] Remove Typeable deriving clauses Since GHC 7.10 Typeable is derived automatically. --- src/Data/IntTrie.hs | 4 +--- src/Data/StringTable.hs | 3 +-- src/Data/TarIndex.hs | 7 +++---- src/Distribution/Client/Cron.hs | 5 ++--- src/Distribution/Client/Mirror/Session.hs | 2 +- src/Distribution/Server/Features/AdminLog.hs | 3 +-- .../Server/Features/AnalyticsPixels/State.hs | 5 ++--- .../Features/BuildReports/BuildReport.hs | 10 ++++------ .../Features/BuildReports/BuildReports.hs | 19 +++++++++---------- .../Server/Features/Core/State.hs | 4 ++-- .../Server/Features/Distro/State.hs | 3 +-- .../Server/Features/Distro/Types.hs | 9 ++++----- .../Server/Features/Documentation/State.hs | 3 +-- .../Server/Features/DownloadCount/State.hs | 3 +-- .../Server/Features/HaskellPlatform/State.hs | 3 +-- .../Server/Features/LegacyPasswds.hs | 3 +-- .../Server/Features/LegacyPasswds/Auth.hs | 3 +-- .../Features/PackageCandidates/State.hs | 6 ++---- .../Features/PackageCandidates/Types.hs | 3 +-- .../Server/Features/PackageInfoJSON/State.hs | 3 +-- .../Features/PreferredVersions/State.hs | 7 +++---- .../Features/ReverseDependencies/State.hs | 5 ++--- .../Server/Features/Security/FileInfo.hs | 3 +-- .../Features/Security/ResponseContentTypes.hs | 11 +++++------ .../Server/Features/Security/State.hs | 11 +++++------ .../Server/Features/Tags/State.hs | 9 ++++----- .../Server/Features/TarIndexCache/State.hs | 3 +-- .../Server/Features/Upload/State.hs | 7 +++---- .../Server/Features/UserDetails.hs | 7 +++---- .../Server/Features/UserNotify.hs | 13 ++++++------- .../Server/Features/UserSignup.hs | 5 ++--- .../Server/Features/Votes/State.hs | 3 +-- .../Server/Framework/AuthTypes.hs | 3 +-- .../Server/Framework/BlobStorage.hs | 2 +- .../Server/Packages/PackageIndex.hs | 2 +- src/Distribution/Server/Packages/Types.hs | 8 ++++---- src/Distribution/Server/Users/AuthToken.hs | 5 ++--- src/Distribution/Server/Users/State.hs | 5 ++--- src/Distribution/Server/Users/Types.hs | 13 ++++++------- src/Distribution/Server/Users/UserIdSet.hs | 2 +- src/Distribution/Server/Users/Users.hs | 15 +++++++-------- src/Distribution/Server/Util/CountingMap.hs | 4 ++-- src/Distribution/Server/Util/Nonce.hs | 5 ++--- src/Distribution/Server/Util/TarIndex.hs | 2 +- 44 files changed, 106 insertions(+), 145 deletions(-) diff --git a/src/Data/IntTrie.hs b/src/Data/IntTrie.hs index ff4c6c7fc..6fe6249bc 100644 --- a/src/Data/IntTrie.hs +++ b/src/Data/IntTrie.hs @@ -19,8 +19,6 @@ module Data.IntTrie ( import Prelude hiding (lookup) -import Data.Typeable (Typeable) - import qualified Data.Array.Unboxed as A import Data.Array.IArray ((!)) import qualified Data.Bits as Bits @@ -42,7 +40,7 @@ import Control.Applicative ((<$>), (<*>)) -- | A compact mapping from sequences of small ints to small ints. -- newtype IntTrie k v = IntTrie (A.UArray Word32 Word32) - deriving (Show, Typeable) + deriving (Show) -- Version 0 used 16-bit integers and is no longer supported -- (To upgrade, DELETE /server-status/tarindices to wipe the tar indices state) diff --git a/src/Data/StringTable.hs b/src/Data/StringTable.hs index 60b7416dc..093f60e1f 100644 --- a/src/Data/StringTable.hs +++ b/src/Data/StringTable.hs @@ -16,7 +16,6 @@ import qualified Data.List as List import qualified Data.Array.Unboxed as A import Data.Array.Unboxed ((!)) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) import qualified Data.ByteString.Char8 as BS import Data.Word (Word32) @@ -29,7 +28,7 @@ data StringTable id = StringTable !BS.ByteString -- all the strings concatenated !(A.UArray Int Word32) -- offset table - deriving (Show, Typeable) + deriving (Show) $(deriveSafeCopy 0 'base ''StringTable) diff --git a/src/Data/TarIndex.hs b/src/Data/TarIndex.hs index cd111d962..a467183cc 100644 --- a/src/Data/TarIndex.hs +++ b/src/Data/TarIndex.hs @@ -16,7 +16,6 @@ module Data.TarIndex ( ) where import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) import Codec.Archive.Tar (Entry, GenEntry(..), GenEntryContent(..), Entries, GenEntries(..), entryPath) import qualified Data.StringTable as StringTable @@ -56,16 +55,16 @@ data TarIndex = TarIndex !(StringTable PathComponentId) -- ^ The mapping of filepath components as strings to ids. !(IntTrie PathComponentId TarEntryOffset) -- ^ Mapping of sequences of filepath component ids to tar entry offsets. - deriving (Show, Typeable) + deriving (Show) data TarIndexEntry = TarFileEntry !TarEntryOffset | TarDir [(FilePath, TarIndexEntry)] - deriving (Show, Typeable) + deriving (Show) newtype PathComponentId = PathComponentId Int - deriving (Eq, Ord, Enum, Show, Typeable) + deriving (Eq, Ord, Enum, Show) type TarEntryOffset = Int diff --git a/src/Distribution/Client/Cron.hs b/src/Distribution/Client/Cron.hs index c0fd9f9a7..daa36d9fa 100644 --- a/src/Distribution/Client/Cron.hs +++ b/src/Distribution/Client/Cron.hs @@ -13,7 +13,6 @@ import System.Random (randomRIO) import Data.Time.Format (defaultTimeLocale, formatTime) import Data.Time.Clock (UTCTime, getCurrentTime, addUTCTime) import Data.Time.LocalTime (getCurrentTimeZone, utcToZonedTime) -import Data.Typeable (Typeable) import qualified System.Posix.Signals as Posix @@ -21,13 +20,13 @@ import Distribution.Verbosity (Verbosity) import Distribution.Simple.Utils hiding (warn) data ReceivedSignal = ReceivedSignal Signal UTCTime - deriving (Show, Typeable) + deriving (Show) data Signal = SIGABRT | SIGINT | SIGQUIT | SIGTERM - deriving (Show, Typeable) + deriving (Show) instance Exception ReceivedSignal diff --git a/src/Distribution/Client/Mirror/Session.hs b/src/Distribution/Client/Mirror/Session.hs index 60d561a30..9d63f9c96 100644 --- a/src/Distribution/Client/Mirror/Session.hs +++ b/src/Distribution/Client/Mirror/Session.hs @@ -237,7 +237,7 @@ data MirrorError = MirrorIOError IOError | PutPackageError PackageId ErrorResponse | Interrupted | InvalidOption String - deriving (Typeable,Show) + deriving (Show) instance Exception MirrorError diff --git a/src/Distribution/Server/Features/AdminLog.hs b/src/Distribution/Server/Features/AdminLog.hs index 35f01fcf0..2e2a7ff8d 100755 --- a/src/Distribution/Server/Features/AdminLog.hs +++ b/src/Distribution/Server/Features/AdminLog.hs @@ -13,7 +13,6 @@ import Distribution.Server.Pages.AdminLog import Distribution.Server.Features.Users import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable import Data.Maybe(mapMaybe) import Control.Monad.Reader import qualified Control.Monad.State as State @@ -50,7 +49,7 @@ mkAdminAction gd isAdd uid = (if isAdd then Admin_GroupAddUser else Admin_GroupD newtype AdminLog = AdminLog { adminLog :: [(UTCTime,UserId,AdminAction,BS.ByteString)] -} deriving (Typeable, Show, MemSize) +} deriving (Show, MemSize) deriveSafeCopy 0 'base ''AdminLog diff --git a/src/Distribution/Server/Features/AnalyticsPixels/State.hs b/src/Distribution/Server/Features/AnalyticsPixels/State.hs index d31b91642..1684880a5 100644 --- a/src/Distribution/Server/Features/AnalyticsPixels/State.hs +++ b/src/Distribution/Server/Features/AnalyticsPixels/State.hs @@ -20,7 +20,6 @@ import Distribution.Server.Framework.MemSize (MemSize) import Distribution.Server.Users.State () import Data.Text (Text) -import Data.Typeable (Typeable) import Data.Map (Map) import qualified Data.Map.Strict as Map import Data.Acid (Query, Update, makeAcidic) @@ -36,13 +35,13 @@ newtype AnalyticsPixel = AnalyticsPixel { analyticsPixelUrl :: Text } - deriving (Show, Eq, Ord, NFData, Typeable, MemSize) + deriving (Show, Eq, Ord, NFData, MemSize) newtype AnalyticsPixelsState = AnalyticsPixelsState { analyticsPixels :: Map PackageName (Set AnalyticsPixel) } - deriving (Show, Eq, NFData, Typeable, MemSize) + deriving (Show, Eq, NFData, MemSize) -- SafeCopy instances $(deriveSafeCopy 0 'base ''AnalyticsPixel) diff --git a/src/Distribution/Server/Features/BuildReports/BuildReport.hs b/src/Distribution/Server/Features/BuildReports/BuildReport.hs index 232675db8..c4ddda0a3 100644 --- a/src/Distribution/Server/Features/BuildReports/BuildReport.hs +++ b/src/Distribution/Server/Features/BuildReports/BuildReport.hs @@ -106,8 +106,6 @@ import qualified Data.ByteString.Char8 as BS import qualified Data.Map as Map import Data.Time ( UTCTime, getCurrentTime ) -import Data.Typeable - ( Typeable ) import Control.Applicative import Control.Monad @@ -166,7 +164,7 @@ data BuildReport -- | Configure outcome, did configure work ok? testsOutcome :: Outcome } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) packageL :: Lens' BuildReport PackageIdentifier packageL f s = fmap (\x -> s { package = x }) (f (package s)) @@ -266,7 +264,7 @@ data BooleanCovg = BooleanCovg { guards :: (Int,Int), ifConditions :: (Int,Int), qualifiers :: (Int,Int) -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) data BuildCovg = BuildCovg { expressions :: (Int,Int), @@ -274,7 +272,7 @@ data BuildCovg = BuildCovg { alternatives :: (Int,Int), localDeclarations :: (Int,Int), topLevel :: (Int,Int) -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) instance MemSize BuildCovg where memSize (BuildCovg a (BooleanCovg b c d) e f g) = memSize7 a b c d e f g @@ -499,7 +497,7 @@ instance Arbitrary Outcome where arbitrary = elements [ NotTried, Failed, Ok ] data BuildStatus = BuildOK | BuildFailCnt Int - deriving (Eq, Ord, Typeable, Show) + deriving (Eq, Ord, Show) instance ToJSON BuildStatus where toJSON (BuildFailCnt a) = toJSON a toJSON BuildOK = toJSON ((-1)::Int) diff --git a/src/Distribution/Server/Features/BuildReports/BuildReports.hs b/src/Distribution/Server/Features/BuildReports/BuildReports.hs index fa650eda5..831c8a925 100644 --- a/src/Distribution/Server/Features/BuildReports/BuildReports.hs +++ b/src/Distribution/Server/Features/BuildReports/BuildReports.hs @@ -50,7 +50,6 @@ import qualified Data.Map as Map import qualified Data.Serialize as Serialize import Data.Serialize (Serialize, get, put) import Data.SafeCopy -import Data.Typeable (Typeable) import qualified Data.List as L import qualified Data.Char as Char import Data.Maybe (fromMaybe) @@ -59,7 +58,7 @@ import Text.StringTemplate (ToSElem(..)) newtype BuildReportId = BuildReportId Int - deriving (Eq, Ord, Typeable, Show, MemSize, Pretty) + deriving (Eq, Ord, Show, MemSize, Pretty) incrementReportId :: BuildReportId -> BuildReportId incrementReportId (BuildReportId n) = BuildReportId (n+1) @@ -81,10 +80,10 @@ instance Parsec BuildReportId where f c = Char.ord c - Char.ord '0' newtype BuildLog = BuildLog BlobStorage.BlobId - deriving (Eq, Typeable, Show, MemSize) + deriving (Eq, Show, MemSize) newtype TestLog = TestLog BlobStorage.BlobId - deriving (Eq, Typeable, Show, MemSize) + deriving (Eq, Show, MemSize) data PkgBuildReports = PkgBuildReports { -- for each report, other useful information: Maybe UserId, UTCTime @@ -96,12 +95,12 @@ data PkgBuildReports = PkgBuildReports { nextReportId :: !BuildReportId, buildStatus :: !BuildStatus, runTests :: !Bool -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) data BuildReports = BuildReports { reportsIndex :: !(Map.Map PackageId PkgBuildReports) -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) emptyPkgReports :: PkgBuildReports emptyPkgReports = PkgBuildReports { @@ -300,7 +299,7 @@ data PkgBuildReports_v3 = PkgBuildReports_v3 { reports_v3 :: !(Map BuildReportId (BuildReport, Maybe BuildLog, Maybe BuildCovg )), nextReportId_v3 :: !BuildReportId, buildStatus_v3 :: !BuildStatus -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) instance SafeCopy PkgBuildReports_v3 where version = 3 @@ -320,7 +319,7 @@ instance MemSize PkgBuildReports_v3 where data PkgBuildReports_v2 = PkgBuildReports_v2 { reports_v2 :: !(Map BuildReportId (BuildReport, Maybe BuildLog)), nextReportId_v2 :: !BuildReportId -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) instance SafeCopy PkgBuildReports_v2 where version = 2 @@ -397,7 +396,7 @@ instance Serialize BuildReports_v0 where data BuildReports_v2 = BuildReports_v2 { reportsIndex_v2 :: !(Map.Map PackageId PkgBuildReports_v2) - } deriving (Eq, Typeable, Show) + } deriving (Eq, Show) instance Migrate BuildReports_v2 where type MigrateFrom BuildReports_v2 = BuildReports_v0 @@ -411,7 +410,7 @@ deriveSafeCopy 2 'extension ''BuildReports_v2 data BuildReports_v3 = BuildReports_v3 { reportsIndex_v3 :: !(Map.Map PackageId PkgBuildReports_v3) - } deriving (Eq, Typeable, Show) + } deriving (Eq, Show) instance Migrate BuildReports_v3 where type MigrateFrom BuildReports_v3 = BuildReports_v2 diff --git a/src/Distribution/Server/Features/Core/State.hs b/src/Distribution/Server/Features/Core/State.hs index ade545b27..91dd51c47 100644 --- a/src/Distribution/Server/Features/Core/State.hs +++ b/src/Distribution/Server/Features/Core/State.hs @@ -51,7 +51,7 @@ data PackagesState = PackagesState { -- for the moment the update log is a 'Either', to help with the transition -- we can change that later } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) -- transient type used for migration which holds the fields for -- 'ExtraEntry' carried over from 'PackagesState_v1' @@ -322,7 +322,7 @@ data PackagesState_v1 = PackagesState_v1 { -- for the moment the update log is a Maybe, to help with the transition -- we can change that later } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) instance Migrate PackagesState_v1 where type MigrateFrom PackagesState_v1 = PackagesState_v0 diff --git a/src/Distribution/Server/Features/Distro/State.hs b/src/Distribution/Server/Features/Distro/State.hs index 65a13f1e1..17bbdb0c7 100644 --- a/src/Distribution/Server/Features/Distro/State.hs +++ b/src/Distribution/Server/Features/Distro/State.hs @@ -16,7 +16,6 @@ import Distribution.Server.Framework.MemSize import Data.Acid (Query, Update, makeAcidic) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable import Data.Maybe (fromMaybe) import Control.Monad (liftM) @@ -27,7 +26,7 @@ data Distros = Distros { distDistros :: !Distributions, distVersions :: !DistroVersions } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) deriveSafeCopy 0 'base ''Distros diff --git a/src/Distribution/Server/Features/Distro/Types.hs b/src/Distribution/Server/Features/Distro/Types.hs index 6ecb13ff6..92225f54e 100644 --- a/src/Distribution/Server/Features/Distro/Types.hs +++ b/src/Distribution/Server/Features/Distro/Types.hs @@ -27,12 +27,11 @@ import qualified Text.PrettyPrint as Disp import qualified Data.Char as Char import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable -- | Distribution names may contain letters, numbers and punctuation. newtype DistroName = DistroName String - deriving (Eq, Ord, Read, Show, Typeable, MemSize) + deriving (Eq, Ord, Read, Show, MemSize) instance Pretty DistroName where pretty (DistroName name) = Disp.text name @@ -44,21 +43,21 @@ instance Parsec DistroName where data Distributions = Distributions { nameMap :: !(Map.Map DistroName UserIdSet) } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) -- | Listing of which distributions have which versions of particular -- packages. data DistroVersions = DistroVersions { packageDistroMap :: !(Map.Map PackageName (Map.Map DistroName DistroPackageInfo)), distroMap :: !(Map.Map DistroName (Set.Set PackageName)) -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) data DistroPackageInfo = DistroPackageInfo { distroVersion :: Version.Version , distroUrl :: String } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) $(deriveSafeCopy 0 'base ''DistroName) $(deriveSafeCopy 0 'base ''Distributions) diff --git a/src/Distribution/Server/Features/Documentation/State.hs b/src/Distribution/Server/Features/Documentation/State.hs index a42fb53bd..beb34a9ab 100644 --- a/src/Distribution/Server/Features/Documentation/State.hs +++ b/src/Distribution/Server/Features/Documentation/State.hs @@ -9,7 +9,6 @@ import Distribution.Server.Framework.MemSize import Data.Acid (Query, Update, makeAcidic) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable import Control.Monad.Reader import qualified Control.Monad.State as State @@ -18,7 +17,7 @@ import qualified Data.Map as Map ---------------------------------- Documentation data Documentation = Documentation { documentation :: !(Map.Map PackageIdentifier BlobId) - } deriving (Typeable, Show, Eq) + } deriving (Show, Eq) deriveSafeCopy 0 'base ''Documentation diff --git a/src/Distribution/Server/Features/DownloadCount/State.hs b/src/Distribution/Server/Features/DownloadCount/State.hs index 71d47ca68..cdd591885 100644 --- a/src/Distribution/Server/Features/DownloadCount/State.hs +++ b/src/Distribution/Server/Features/DownloadCount/State.hs @@ -4,7 +4,6 @@ module Distribution.Server.Features.DownloadCount.State where import Data.Time.Calendar (Day(..)) -import Data.Typeable (Typeable) import Data.Foldable (forM_) import Control.Arrow (first) import Control.Monad (liftM) @@ -51,7 +50,7 @@ data InMemStats = InMemStats { inMemToday :: !Day , inMemCounts :: !(SimpleCountingMap PackageId) } - deriving (Show, Eq, Typeable) + deriving (Show, Eq) newtype OnDiskStats = OnDiskStats { onDiskStats :: NestedCountingMap PackageName OnDiskPerPkg diff --git a/src/Distribution/Server/Features/HaskellPlatform/State.hs b/src/Distribution/Server/Features/HaskellPlatform/State.hs index d3b3e502e..ac3ecbfa2 100644 --- a/src/Distribution/Server/Features/HaskellPlatform/State.hs +++ b/src/Distribution/Server/Features/HaskellPlatform/State.hs @@ -9,7 +9,6 @@ import qualified Data.Map as Map import Data.SafeCopy (base, deriveSafeCopy) import Data.Set (Set) import qualified Data.Set as Set -import Data.Typeable import Distribution.Server.Framework.Instances () import Distribution.Server.Framework.MemSize @@ -22,7 +21,7 @@ import Control.Monad.State (put, modify) newtype PlatformPackages = PlatformPackages { blessedPackages :: Map PackageName (Set Version) -} deriving (Show, Typeable, Eq, MemSize) +} deriving (Show, Eq, MemSize) emptyPlatformPackages :: PlatformPackages emptyPlatformPackages = PlatformPackages Map.empty diff --git a/src/Distribution/Server/Features/LegacyPasswds.hs b/src/Distribution/Server/Features/LegacyPasswds.hs index d167e9e1a..17ec8a757 100644 --- a/src/Distribution/Server/Features/LegacyPasswds.hs +++ b/src/Distribution/Server/Features/LegacyPasswds.hs @@ -29,7 +29,6 @@ import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap import qualified Data.ByteString.Lazy.Char8 as LBS -- ASCII data only (password hashes) -import Data.Typeable (Typeable) import Data.SafeCopy (base, deriveSafeCopy) import Control.Monad.Reader (ask) import Control.Monad.State (get, put) @@ -58,7 +57,7 @@ instance IsHackageFeature LegacyPasswdsFeature where -- newtype LegacyPasswdsTable = LegacyPasswdsTable (IntMap LegacyAuth.HtPasswdHash) - deriving (Eq, Show, Typeable) + deriving (Eq, Show) emptyLegacyPasswdsTable :: LegacyPasswdsTable emptyLegacyPasswdsTable = LegacyPasswdsTable IntMap.empty diff --git a/src/Distribution/Server/Features/LegacyPasswds/Auth.hs b/src/Distribution/Server/Features/LegacyPasswds/Auth.hs index ad848d9a1..09a3cf275 100644 --- a/src/Distribution/Server/Features/LegacyPasswds/Auth.hs +++ b/src/Distribution/Server/Features/LegacyPasswds/Auth.hs @@ -14,7 +14,6 @@ import qualified Distribution.Server.Users.Users as Users import Happstack.Server import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) import qualified Data.ByteString.Char8 as BS -- TODO: Verify that we don't need to worry about UTF8 here @@ -31,7 +30,7 @@ import qualified Data.ByteString.Char8 as BS -- TODO: Verify that we don't need -- Not the same as the new hashes we store in 'PasswdHash'. -- newtype HtPasswdHash = HtPasswdHash String - deriving (Eq, Show, Typeable, MemSize) + deriving (Eq, Show, MemSize) $(deriveSafeCopy 0 'base ''HtPasswdHash) diff --git a/src/Distribution/Server/Features/PackageCandidates/State.hs b/src/Distribution/Server/Features/PackageCandidates/State.hs index 2a1f14957..eac899a7d 100644 --- a/src/Distribution/Server/Features/PackageCandidates/State.hs +++ b/src/Distribution/Server/Features/PackageCandidates/State.hs @@ -2,8 +2,6 @@ module Distribution.Server.Features.PackageCandidates.State where -import Distribution.Server.Prelude - import Distribution.Server.Features.PackageCandidates.Types import Distribution.Server.Framework.MemSize import Distribution.Server.Packages.Types @@ -24,11 +22,11 @@ data CandidatePackages = CandidatePackages { -- | Did we do the migration for PkgTarball, computing hashes for candidates? , candidateMigratedPkgTarball :: Bool - } deriving (Typeable, Show, Eq) + } deriving (Show, Eq) data CandidatePackages_v0 = CandidatePackages_v0 { candidateList_v0 :: !(PackageIndex.PackageIndex CandPkgInfo) - } deriving (Typeable, Show, Eq) + } deriving (Show, Eq) deriveSafeCopy 0 'base ''CandidatePackages_v0 diff --git a/src/Distribution/Server/Features/PackageCandidates/Types.hs b/src/Distribution/Server/Features/PackageCandidates/Types.hs index 839fb694c..e2e82b535 100644 --- a/src/Distribution/Server/Features/PackageCandidates/Types.hs +++ b/src/Distribution/Server/Features/PackageCandidates/Types.hs @@ -16,7 +16,6 @@ import Distribution.Server.Framework.MemSize import Distribution.Package ( PackageIdentifier(..), Package(..) ) -import Data.Typeable (Typeable) import Data.SafeCopy @@ -34,7 +33,7 @@ data CandPkgInfo = CandPkgInfo { candWarnings :: ![String], -- | Whether to allow non-maintainers to view the page or not. candPublic :: !Bool -} deriving (Show, Typeable, Eq) +} deriving (Show, Eq) candInfoId :: CandPkgInfo -> PackageIdentifier candInfoId = pkgInfoId . candPkgInfo diff --git a/src/Distribution/Server/Features/PackageInfoJSON/State.hs b/src/Distribution/Server/Features/PackageInfoJSON/State.hs index 4c50e278a..d101a345a 100644 --- a/src/Distribution/Server/Features/PackageInfoJSON/State.hs +++ b/src/Distribution/Server/Features/PackageInfoJSON/State.hs @@ -26,7 +26,6 @@ import Data.SafeCopy (SafeCopy(..), base, contain, deriveSafeCopy, safeGet, safePut) import Data.Serialize (Get, get, getListOf, getTwoOf, put, putListOf, putTwoOf) -import Data.Typeable (Typeable) import Data.Word (Word8) import Distribution.License (licenseToSPDX) import Distribution.Text (display, simpleParse) @@ -195,7 +194,7 @@ data PackageInfoState = PackageInfoState { descriptions :: !(Map.Map (PackageIdentifier, Maybe Int) PackageBasicDescription) , versions :: !(Map.Map PackageName PackageVersions) , migratedEphemeralData :: Bool - } deriving (Show, Typeable, Eq) + } deriving (Show, Eq) getDescriptionFor :: (PackageIdentifier, Maybe Int) diff --git a/src/Distribution/Server/Features/PreferredVersions/State.hs b/src/Distribution/Server/Features/PreferredVersions/State.hs index 3c4881b1f..e4cb5c8a0 100644 --- a/src/Distribution/Server/Features/PreferredVersions/State.hs +++ b/src/Distribution/Server/Features/PreferredVersions/State.hs @@ -10,7 +10,6 @@ import Distribution.Version import Data.Acid (Query, Update, makeAcidic) import Data.Maybe (fromMaybe, isNothing) -import Data.Typeable (Typeable) import Control.Arrow (second) import Control.Monad (ap) import Control.Monad.State (put, modify) @@ -25,13 +24,13 @@ data PreferredVersions = PreferredVersions { preferredMap :: Map PackageName PreferredInfo, deprecatedMap :: Map PackageName [PackageName], migratedEphemeralPrefs :: Bool -} deriving (Typeable, Show, Eq) +} deriving (Show, Eq) data PreferredInfo = PreferredInfo { preferredRanges :: [VersionRange], deprecatedVersions :: [Version], sumRange :: Maybe VersionRange -- cached form of 'consolidateRanges' below -} deriving (Typeable, Show, Eq) +} deriving (Show, Eq) emptyPreferredInfo :: PreferredInfo emptyPreferredInfo = PreferredInfo [] [] Nothing @@ -43,7 +42,7 @@ consolidateRanges ranges depr = then Nothing else Just range -data VersionStatus = NormalVersion | DeprecatedVersion | UnpreferredVersion deriving (Show, Typeable, Eq, Ord, Enum) +data VersionStatus = NormalVersion | DeprecatedVersion | UnpreferredVersion deriving (Show, Eq, Ord, Enum) getVersionStatus :: PreferredInfo -> Version -> VersionStatus getVersionStatus info version diff --git a/src/Distribution/Server/Features/ReverseDependencies/State.hs b/src/Distribution/Server/Features/ReverseDependencies/State.hs index 7e3992e41..88df8752a 100644 --- a/src/Distribution/Server/Features/ReverseDependencies/State.hs +++ b/src/Distribution/Server/Features/ReverseDependencies/State.hs @@ -40,7 +40,6 @@ import qualified Data.Map as Map import Data.Maybe (mapMaybe, maybeToList) import qualified Data.Set as Set import Data.Set (Set, fromList, toList, delete) -import Data.Typeable (Typeable) import Data.Graph (Graph, Vertex) import qualified Data.Graph as Gr @@ -66,7 +65,7 @@ data ReverseIndex = ReverseIndex { reverseDependencies :: !RevDeps , packageNodeIdMap :: !(Bimap PackageName NodeId) , deps :: Map PackageIdentifier [Dependency] - } deriving (Eq, Show, Typeable) + } deriving (Eq, Show) instance MemSize Dependency where memSize = fromIntegral . BS.length . encode @@ -150,7 +149,7 @@ harvestDependencies (CondNode _ dependencies comps) = dependencies ++ concatMap data ReverseCount = ReverseCount { directCount :: Int , totalCount :: Int - } deriving (Show, Eq, Typeable, Ord) + } deriving (Show, Eq, Ord) instance MemSize ReverseCount where memSize (ReverseCount a b) = memSize2 a b diff --git a/src/Distribution/Server/Features/Security/FileInfo.hs b/src/Distribution/Server/Features/Security/FileInfo.hs index e465c9350..bb9c26411 100644 --- a/src/Distribution/Server/Features/Security/FileInfo.hs +++ b/src/Distribution/Server/Features/Security/FileInfo.hs @@ -11,7 +11,6 @@ module Distribution.Server.Features.Security.FileInfo ( ) where -- stdlib -import Data.Typeable import Data.SafeCopy import qualified Data.Map as Map @@ -41,7 +40,7 @@ data FileInfo = FileInfo { , fileInfoSHA256 :: !SHA256Digest , fileInfoMD5 :: !(Maybe MD5Digest) } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) data FileInfo_v0 = FileInfo_v0 Sec.Int54 SHA256Digest diff --git a/src/Distribution/Server/Features/Security/ResponseContentTypes.hs b/src/Distribution/Server/Features/Security/ResponseContentTypes.hs index dcb6030da..b9b424e1d 100644 --- a/src/Distribution/Server/Features/Security/ResponseContentTypes.hs +++ b/src/Distribution/Server/Features/Security/ResponseContentTypes.hs @@ -16,7 +16,6 @@ module Distribution.Server.Features.Security.ResponseContentTypes ( -- stdlib import Happstack.Server import Control.DeepSeq -import Data.Typeable import Data.SafeCopy import qualified Data.ByteString.Lazy as BS.Lazy @@ -36,7 +35,7 @@ data TUFFile = TUFFile { , _tufFileHashMD5 :: !MD5Digest , _tufFileHashSHA256 :: !SHA256Digest } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) deriveSafeCopy 0 'base ''TUFFile @@ -86,19 +85,19 @@ instance IsTUFFile TUFFile where tufFileHashSHA256 TUFFile{..} = _tufFileHashSHA256 newtype Timestamp = Timestamp { timestampFile :: TUFFile } - deriving (Typeable, Show, Eq, NFData, MemSize, + deriving (Show, Eq, NFData, MemSize, ToMessage, IsTUFFile, HasFileInfo) newtype Snapshot = Snapshot { snapshotFile :: TUFFile } - deriving (Typeable, Show, Eq, NFData, MemSize, + deriving (Show, Eq, NFData, MemSize, ToMessage, IsTUFFile, HasFileInfo) newtype Root = Root { rootFile :: TUFFile } - deriving (Typeable, Show, Eq, NFData, MemSize, + deriving (Show, Eq, NFData, MemSize, ToMessage, IsTUFFile, HasFileInfo) newtype Mirrors = Mirrors { mirrorsFile :: TUFFile } - deriving (Typeable, Show, Eq, NFData, MemSize, + deriving (Show, Eq, NFData, MemSize, ToMessage, IsTUFFile, HasFileInfo) deriveSafeCopy 0 'base ''Timestamp diff --git a/src/Distribution/Server/Features/Security/State.hs b/src/Distribution/Server/Features/Security/State.hs index dad42fcd8..46e880b5a 100644 --- a/src/Distribution/Server/Features/Security/State.hs +++ b/src/Distribution/Server/Features/Security/State.hs @@ -14,7 +14,6 @@ import Data.Maybe import Data.SafeCopy import Data.Time import Data.Time.Clock.POSIX (posixSecondsToUTCTime) -import Data.Typeable import qualified Control.Monad.State as State import qualified Data.ByteString.Lazy as BS.Lazy @@ -52,7 +51,7 @@ data SecurityState = , securityTimestampTime :: !UTCTime -- ^ when the snapshot.json and -- timestamp.json last got updated } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) data SecurityStateFiles = SecurityStateFiles { @@ -65,7 +64,7 @@ data SecurityStateFiles = , securitySnapshot :: Snapshot -- ^ content of snapshot.json , securityTimestamp :: Timestamp -- ^ content of timestamp.json } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) deriveSafeCopy 0 'base ''SecurityStateFiles @@ -251,7 +250,7 @@ data TUFUpdate = TUFUpdate { , tufUpdateInfoTarGz :: FileInfo , tufUpdateInfoTar :: FileInfo } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) deriveSafeCopy 0 'base ''TUFUpdate @@ -374,7 +373,7 @@ data SecurityState_v0 = SecurityState_v0 { , v0_securityTimestampVersion :: Sec.FileVersion , v0_securitySnapshotVersion :: Sec.FileVersion } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) deriveSafeCopy 0 'base ''SecurityState_v0 @@ -395,7 +394,7 @@ data SecurityState_v1 = SecurityState_v1 { , v1_securitySnapshotVersion :: Sec.FileVersion , v1_securityLastUpdate :: Maybe TUFUpdate } - deriving (Typeable, Show, Eq) + deriving (Show, Eq) deriveSafeCopy 1 'extension ''SecurityState_v1 diff --git a/src/Distribution/Server/Features/Tags/State.hs b/src/Distribution/Server/Features/Tags/State.hs index f92a67346..1bdb6be21 100644 --- a/src/Distribution/Server/Features/Tags/State.hs +++ b/src/Distribution/Server/Features/Tags/State.hs @@ -18,7 +18,6 @@ import Data.Set (Set) import qualified Data.Set as Set import Control.Monad (liftM2) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) import qualified Data.Char as Char import Data.Functor ( (<&>) ) import Data.Maybe (fromMaybe) @@ -27,7 +26,7 @@ import Control.Monad.State (get, put, modify) import Control.Monad.Reader (ask, asks) import Control.DeepSeq -newtype TagList = TagList [Tag] deriving (Show, Typeable) +newtype TagList = TagList [Tag] deriving (Show) instance Pretty TagList where pretty (TagList tags) = Disp.hsep . Disp.punctuate Disp.comma $ map pretty tags @@ -36,7 +35,7 @@ instance Parsec TagList where -- A tag is a string describing a package; presently the preferred word-separation -- character is the dash. -newtype Tag = Tag String deriving (Show, Typeable, Ord, Eq, NFData, MemSize) +newtype Tag = Tag String deriving (Show, Ord, Eq, NFData, MemSize) instance Pretty Tag where pretty (Tag tag) = Disp.text tag @@ -72,10 +71,10 @@ data PackageTags = PackageTags { tagPackages :: Map Tag (Set PackageName), -- Packagename (Proposed Additions, Proposed Deletions) reviewTags :: Map PackageName (Set Tag, Set Tag) -} deriving (Eq, Show, Typeable) +} deriving (Eq, Show) -data TagAlias = TagAlias (Map Tag (Set Tag)) deriving (Eq, Show, Typeable) +data TagAlias = TagAlias (Map Tag (Set Tag)) deriving (Eq, Show) addTagAlias :: Tag -> Tag -> Update TagAlias () addTagAlias tag alias = do diff --git a/src/Distribution/Server/Features/TarIndexCache/State.hs b/src/Distribution/Server/Features/TarIndexCache/State.hs index 0dc62cc22..0ff2d3897 100644 --- a/src/Distribution/Server/Features/TarIndexCache/State.hs +++ b/src/Distribution/Server/Features/TarIndexCache/State.hs @@ -10,7 +10,6 @@ module Distribution.Server.Features.TarIndexCache.State ( -- TODO: use strict map? (Can we rely on containers >= 0.5?) -import Data.Typeable (Typeable) import Control.Monad.Reader (ask, asks) import Control.Monad.State (put, modify) import Data.Map (Map) @@ -25,7 +24,7 @@ import Distribution.Server.Framework.MemSize data TarIndexCache = TarIndexCache { tarIndexCacheMap :: Map BlobId BlobId } - deriving (Eq, Show, Typeable) + deriving (Eq, Show) $(deriveSafeCopy 0 'base ''TarIndexCache) diff --git a/src/Distribution/Server/Features/Upload/State.hs b/src/Distribution/Server/Features/Upload/State.hs index 79a180210..1b98e155b 100644 --- a/src/Distribution/Server/Features/Upload/State.hs +++ b/src/Distribution/Server/Features/Upload/State.hs @@ -12,7 +12,6 @@ import Distribution.Server.Users.Group (UserIdSet) import Data.Acid (Query, Update, makeAcidic) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable import Control.Monad.Reader import qualified Control.Monad.State as State import Data.Maybe (fromMaybe) @@ -22,7 +21,7 @@ import qualified Data.Map as Map -------------------------------- Maintainer list data PackageMaintainers = PackageMaintainers { maintainers :: Map.Map PackageName UserIdSet -} deriving (Eq, Show, Typeable) +} deriving (Eq, Show) deriveSafeCopy 0 'base ''PackageMaintainers @@ -66,7 +65,7 @@ makeAcidic ''PackageMaintainers ['getPackageMaintainers -- this could be reasonably merged into the above, as a PackageGroups data structure data HackageTrustees = HackageTrustees { trusteeList :: !UserIdSet -} deriving (Show, Typeable, Eq) +} deriving (Show, Eq) deriveSafeCopy 0 'base ''HackageTrustees @@ -104,7 +103,7 @@ makeAcidic ''HackageTrustees ['getHackageTrustees -------------------------------- Uploader list data HackageUploaders = HackageUploaders { uploaderList :: !UserIdSet -} deriving (Show, Typeable, Eq) +} deriving (Show, Eq) $(deriveSafeCopy 0 'base ''HackageUploaders) diff --git a/src/Distribution/Server/Features/UserDetails.hs b/src/Distribution/Server/Features/UserDetails.hs index 6240e9e8c..0156cfcb9 100644 --- a/src/Distribution/Server/Features/UserDetails.hs +++ b/src/Distribution/Server/Features/UserDetails.hs @@ -29,7 +29,6 @@ import qualified Data.Text as T import qualified Data.Aeson as Aeson import Data.Aeson.TH -import Data.Typeable (Typeable) import Control.Monad.Reader (ask) import Control.Monad.State (get, put) @@ -61,14 +60,14 @@ data AccountDetails = AccountDetails { accountKind :: Maybe AccountKind, accountAdminNotes :: !Text } - deriving (Eq, Show, Typeable) + deriving (Eq, Show) data AccountKind = AccountKindRealUser | AccountKindSpecial - deriving (Eq, Show, Typeable, Enum, Bounded) + deriving (Eq, Show, Enum, Bounded) newtype UserDetailsTable = UserDetailsTable (IntMap AccountDetails) - deriving (Eq, Show, Typeable) + deriving (Eq, Show) data NameAndContact = NameAndContact { ui_name :: Text, ui_contactEmailAddress :: Text } data AdminInfo = AdminInfo { ui_accountKind :: Maybe AccountKind, ui_notes :: Text } diff --git a/src/Distribution/Server/Features/UserNotify.hs b/src/Distribution/Server/Features/UserNotify.hs index b3db49bef..454302ec7 100644 --- a/src/Distribution/Server/Features/UserNotify.hs +++ b/src/Distribution/Server/Features/UserNotify.hs @@ -75,7 +75,6 @@ import Data.Ord (Down(..), comparing) import Data.SafeCopy (Migrate(migrate), MigrateFrom, base, deriveSafeCopy, extension) import Data.Time (UTCTime(..), addUTCTime, defaultTimeLocale, diffUTCTime, formatTime, getCurrentTime) import Data.Time.Format.Internal (buildTime) -import Data.Typeable (Typeable) import Distribution.Text (display) import Network.Mail.Mime import Network.URI (uriAuthority, uriPath, uriRegName) @@ -122,7 +121,7 @@ data NotifyPref_v0 = NotifyPref_v0 v0notifyDocBuilderReport :: Bool, v0notifyPendingTags :: Bool } - deriving (Eq, Read, Show, Typeable) + deriving (Eq, Read, Show) data NotifyPref = NotifyPref { notifyOptOut :: Bool, @@ -134,7 +133,7 @@ data NotifyPref = NotifyPref notifyDependencyForMaintained :: Bool, notifyDependencyTriggerBounds :: NotifyTriggerBounds } - deriving (Eq, Read, Show, Typeable) + deriving (Eq, Read, Show) defaultNotifyPrefs :: NotifyPref defaultNotifyPrefs = NotifyPref { @@ -148,7 +147,7 @@ defaultNotifyPrefs = NotifyPref { notifyDependencyTriggerBounds = NewIncompatibility } -data NotifyRevisionRange = NotifyAllVersions | NotifyNewestVersion | NoNotifyRevisions deriving (Bounded, Enum, Eq, Read, Show, Typeable) +data NotifyRevisionRange = NotifyAllVersions | NotifyNewestVersion | NoNotifyRevisions deriving (Bounded, Enum, Eq, Read, Show) instance MemSize NotifyRevisionRange where memSize _ = 1 @@ -165,7 +164,7 @@ data NotifyTriggerBounds = Always | BoundsOutOfRange | NewIncompatibility - deriving (Bounded, Enum, Eq, Read, Show, Typeable) + deriving (Bounded, Enum, Eq, Read, Show) instance MemSize NotifyTriggerBounds where memSize _ = 1 @@ -179,7 +178,7 @@ instance MemSize NotifyPref where memSize NotifyPref{..} = memSize8 notifyOpt notifyDocBuilderReport notifyPendingTags notifyDependencyForMaintained notifyDependencyTriggerBounds -data NotifyData = NotifyData {unNotifyData :: (Map.Map UserId NotifyPref, UTCTime)} deriving (Eq, Show, Typeable) +data NotifyData = NotifyData {unNotifyData :: (Map.Map UserId NotifyPref, UTCTime)} deriving (Eq, Show) instance MemSize NotifyData where memSize (NotifyData x) = memSize x @@ -249,7 +248,7 @@ data NotifyPrefUI , ui_notifyDependencyForMaintained :: OK , ui_notifyDependencyTriggerBounds :: NotifyTriggerBounds } - deriving (Eq, Show, Typeable) + deriving (Eq, Show) $(deriveJSON (compatAesonOptionsDropPrefix "ui_") ''NotifyPrefUI) diff --git a/src/Distribution/Server/Features/UserSignup.hs b/src/Distribution/Server/Features/UserSignup.hs index 1584e4094..65c29f9e5 100644 --- a/src/Distribution/Server/Features/UserSignup.hs +++ b/src/Distribution/Server/Features/UserSignup.hs @@ -32,7 +32,6 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.ByteString.Char8 as BS -- Only used for ASCII data import qualified Data.ByteString.Lazy as BSL -import Data.Typeable (Typeable) import Control.Monad.Reader (ask) import Control.Monad.State (get, put, modify) import Data.SafeCopy (base, deriveSafeCopy) @@ -105,10 +104,10 @@ data SignupResetInfo = SignupInfo { resetUserId :: !UserId, nonceTimestamp :: !UTCTime } - deriving (Eq, Show, Typeable) + deriving (Eq, Show) newtype SignupResetTable = SignupResetTable (Map Nonce SignupResetInfo) - deriving (Eq, Show, Typeable, MemSize) + deriving (Eq, Show, MemSize) emptySignupResetTable :: SignupResetTable emptySignupResetTable = SignupResetTable Map.empty diff --git a/src/Distribution/Server/Features/Votes/State.hs b/src/Distribution/Server/Features/Votes/State.hs index 7e31cd6b2..1abf5b209 100644 --- a/src/Distribution/Server/Features/Votes/State.hs +++ b/src/Distribution/Server/Features/Votes/State.hs @@ -12,7 +12,6 @@ import qualified Distribution.Server.Users.UserIdSet as UserIdSet import Distribution.Server.Users.State () -import Data.Typeable import Data.Map (Map) import qualified Data.Map as Map import Data.List @@ -29,7 +28,7 @@ type Score = Int newtype VotesState_v0 = VotesState_v0 { votesMap :: Map PackageName UserIdSet } newtype VotesState = VotesState (Map PackageName (Map UserId Score)) - deriving (Show, Eq, Typeable, MemSize) + deriving (Show, Eq, MemSize) -- SafeCopy instances deriveSafeCopy 0 'base ''VotesState_v0 diff --git a/src/Distribution/Server/Framework/AuthTypes.hs b/src/Distribution/Server/Framework/AuthTypes.hs index 824608633..b68875735 100644 --- a/src/Distribution/Server/Framework/AuthTypes.hs +++ b/src/Distribution/Server/Framework/AuthTypes.hs @@ -4,7 +4,6 @@ module Distribution.Server.Framework.AuthTypes where import Distribution.Server.Framework.MemSize import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) -- | A plain, unhashed password. Careful what you do with them. -- @@ -19,7 +18,7 @@ newtype PasswdPlain = PasswdPlain String -- us to use either the basic or digest HTTP authentication methods. -- newtype PasswdHash = PasswdHash String - deriving (Eq, Ord, Show, Typeable, MemSize) + deriving (Eq, Ord, Show, MemSize) newtype RealmName = RealmName String deriving (Show, Eq) diff --git a/src/Distribution/Server/Framework/BlobStorage.hs b/src/Distribution/Server/Framework/BlobStorage.hs index 38bdcf8c4..4124d0d07 100644 --- a/src/Distribution/Server/Framework/BlobStorage.hs +++ b/src/Distribution/Server/Framework/BlobStorage.hs @@ -71,7 +71,7 @@ import System.Posix.IO ( -- | An id for a blob. The content of the blob is stable. -- newtype BlobId = BlobId MD5Digest - deriving (Eq, Ord, Show, Typeable, MemSize) + deriving (Eq, Ord, Show, MemSize) instance ToJSON BlobId where toJSON = toJSON . blobMd5 diff --git a/src/Distribution/Server/Packages/PackageIndex.hs b/src/Distribution/Server/Packages/PackageIndex.hs index 228e5b768..9482f0f4c 100644 --- a/src/Distribution/Server/Packages/PackageIndex.hs +++ b/src/Distribution/Server/Packages/PackageIndex.hs @@ -84,7 +84,7 @@ newtype PackageIndex pkg = PackageIndex -- (Map PackageName [pkg]) - deriving (Show, Read, Typeable, MemSize) + deriving (Show, Read, MemSize) instance Eq pkg => Eq (PackageIndex pkg) where PackageIndex m1 == PackageIndex m2 = flip Foldable.all (mergeMaps m1 m2) $ \mr -> case mr of diff --git a/src/Distribution/Server/Packages/Types.hs b/src/Distribution/Server/Packages/Types.hs index 220e90a17..1bf06236e 100644 --- a/src/Distribution/Server/Packages/Types.hs +++ b/src/Distribution/Server/Packages/Types.hs @@ -70,7 +70,7 @@ data PkgInfo = PkgInfo { -- pkgTarballRevisions :: !(Vec.Vector (PkgTarball, UploadInfo)) -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) data PkgInfo_v2 = PkgInfo_v2 { v2_pkgInfoId :: !PackageIdentifier, @@ -95,7 +95,7 @@ data BlobInfo = BlobInfo { blobInfoId :: !BlobId, blobInfoLength :: !Int, blobInfoHashSHA256 :: !SHA256Digest -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) blobInfoHashMD5 :: BlobInfo -> MD5Digest blobInfoHashMD5 = BlobStorage.blobMd5Digest . blobInfoId @@ -109,12 +109,12 @@ data PkgTarball = -- translation from PkgTarball_v1 to this PkgTarball requires access to the blob -- store and is therefore not pure.) | PkgTarball_v2_v1 PkgTarball_v1 - deriving (Eq, Typeable, Show) + deriving (Eq, Show) data PkgTarball_v1 = PkgTarball_v1 { v1_pkgTarballGz :: !BlobId, v1_pkgTarballNoGz :: !BlobId -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) data PkgTarball_v0 = PkgTarball_v0 !BlobId_v0 !BlobId_v0 diff --git a/src/Distribution/Server/Users/AuthToken.hs b/src/Distribution/Server/Users/AuthToken.hs index 019439569..4a2174270 100644 --- a/src/Distribution/Server/Users/AuthToken.hs +++ b/src/Distribution/Server/Users/AuthToken.hs @@ -24,18 +24,17 @@ import Distribution.Parsec (Parsec(..)) import qualified Distribution.Compat.CharParsing as P import Data.SafeCopy -import Data.Typeable (Typeable) -- | Contains the original token which will be shown to the user -- once and is NOT stored on the server. The user is expected -- to provide this token on each request that should be -- authed by it newtype OriginalToken = OriginalToken Nonce - deriving (Eq, Ord, Show, Typeable) + deriving (Eq, Ord, Show) -- | Contains a hash of the original token newtype AuthToken = AuthToken BSS.ShortByteString - deriving (Eq, Ord, Read, Show, Typeable, MemSize) + deriving (Eq, Ord, Read, Show, MemSize) convertToken :: OriginalToken -> AuthToken convertToken (OriginalToken bs) = diff --git a/src/Distribution/Server/Users/State.hs b/src/Distribution/Server/Users/State.hs index d828c62db..1d15c97e9 100644 --- a/src/Distribution/Server/Users/State.hs +++ b/src/Distribution/Server/Users/State.hs @@ -14,7 +14,6 @@ import qualified Distribution.Server.Users.Users as Users import Data.Acid (Query, Update, makeAcidic) import Data.SafeCopy (base, deriveSafeCopy) -import Data.Typeable (Typeable) import Control.Monad.Reader import qualified Control.Monad.State as State @@ -104,7 +103,7 @@ $(makeAcidic ''Users.Users [ 'addUserEnabled data HackageAdmins = HackageAdmins { adminList :: !Group.UserIdSet -} deriving (Typeable, Eq, Show) +} deriving (Eq, Show) $(deriveSafeCopy 0 'base ''HackageAdmins) @@ -142,7 +141,7 @@ $(makeAcidic ''HackageAdmins -------------------------------------------------------------------------- data MirrorClients = MirrorClients { mirrorClients :: !Group.UserIdSet -} deriving (Eq, Typeable, Show) +} deriving (Eq, Show) $(deriveSafeCopy 0 'base ''MirrorClients) diff --git a/src/Distribution/Server/Users/Types.hs b/src/Distribution/Server/Users/Types.hs index f1f62bd74..b297ab800 100644 --- a/src/Distribution/Server/Users/Types.hs +++ b/src/Distribution/Server/Users/Types.hs @@ -25,30 +25,29 @@ import qualified Data.List as L import Data.Aeson (ToJSON, FromJSON) import Data.SafeCopy (base, extension, deriveSafeCopy, Migrate(..)) -import Data.Typeable (Typeable) import Data.Hashable import Data.Serialize (Serialize) newtype UserId = UserId Int - deriving newtype (Eq, Ord, Read, Show, Typeable, MemSize, ToJSON, FromJSON, Pretty) + deriving newtype (Eq, Ord, Read, Show, MemSize, ToJSON, FromJSON, Pretty) newtype UserName = UserName String - deriving newtype (Eq, Ord, Read, Show, Typeable, MemSize, ToJSON, FromJSON, Hashable, Serialize) + deriving newtype (Eq, Ord, Read, Show, MemSize, ToJSON, FromJSON, Hashable, Serialize) data UserInfo = UserInfo { userName :: !UserName, userStatus :: !UserStatus, userTokens :: !(M.Map AuthToken T.Text) -- tokens and descriptions - } deriving (Eq, Show, Typeable) + } deriving (Eq, Show) data UserStatus = AccountEnabled UserAuth | AccountDisabled (Maybe UserAuth) | AccountDeleted - deriving (Eq, Show, Typeable) + deriving (Eq, Show) newtype UserAuth = UserAuth PasswdHash - deriving (Show, Eq, Typeable) + deriving (Show, Eq) isActiveAccount :: UserStatus -> Bool isActiveAccount (AccountEnabled _) = True @@ -93,7 +92,7 @@ isValidUserNameChar c = (c < '\127' && Char.isAlphaNum c) || (c == '_') data UserInfo_v0 = UserInfo_v0 { userName_v0 :: !UserName, userStatus_v0 :: !UserStatus - } deriving (Eq, Show, Typeable) + } deriving (Eq, Show) $(deriveSafeCopy 0 'base ''UserId) $(deriveSafeCopy 0 'base ''UserName) diff --git a/src/Distribution/Server/Users/UserIdSet.hs b/src/Distribution/Server/Users/UserIdSet.hs index 3190bd69b..108b3e8b6 100644 --- a/src/Distribution/Server/Users/UserIdSet.hs +++ b/src/Distribution/Server/Users/UserIdSet.hs @@ -29,7 +29,7 @@ import Data.Aeson (ToJSON) -- anywhere a set of users identified by 'UserId' is needed. -- newtype UserIdSet = UserIdSet IntSet.IntSet - deriving (Eq, Semigroup, Monoid, Typeable, Show, NFData, MemSize, ToJSON) + deriving (Eq, Semigroup, Monoid, Show, NFData, MemSize, ToJSON) empty :: UserIdSet empty = UserIdSet IntSet.empty diff --git a/src/Distribution/Server/Users/Users.hs b/src/Distribution/Server/Users/Users.hs index ae9115d42..2881cb7a7 100644 --- a/src/Distribution/Server/Users/Users.hs +++ b/src/Distribution/Server/Users/Users.hs @@ -50,7 +50,6 @@ import Data.List (sort, group, foldl') import qualified Data.Map as Map import qualified Data.IntMap as IntMap import Data.SafeCopy (base, deriveSafeCopy, extension, Migrate(..)) -import Data.Typeable (Typeable) import Control.Exception (assert) import qualified Data.Text as T @@ -68,7 +67,7 @@ data Users = Users { -- | A map from 'AuthToken' to 'UserId' for quick token based auth authTokenMap :: !(Map.Map AuthToken UserId) } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) instance MemSize Users where memSize (Users a b c d) = memSize4 a b c d @@ -147,11 +146,11 @@ emptyUsers = Users { } -- error codes -data ErrUserNameClash = ErrUserNameClash deriving Typeable -data ErrUserIdClash = ErrUserIdClash deriving Typeable -data ErrNoSuchUserId = ErrNoSuchUserId deriving Typeable -data ErrDeletedUser = ErrDeletedUser deriving Typeable -data ErrTokenNotOwned = ErrTokenNotOwned deriving Typeable +data ErrUserNameClash = ErrUserNameClash +data ErrUserIdClash = ErrUserIdClash +data ErrNoSuchUserId = ErrNoSuchUserId +data ErrDeletedUser = ErrDeletedUser +data ErrTokenNotOwned = ErrTokenNotOwned $(deriveSafeCopy 0 'base ''ErrUserNameClash) $(deriveSafeCopy 0 'base ''ErrUserIdClash) @@ -377,7 +376,7 @@ data Users_v0 = Users_v0 { -- | The next available UserId nextId_v0 :: !UserId } - deriving (Eq, Typeable, Show) + deriving (Eq, Show) $(deriveSafeCopy 0 'base ''Users_v0) diff --git a/src/Distribution/Server/Util/CountingMap.hs b/src/Distribution/Server/Util/CountingMap.hs index af1153cda..45ae44687 100644 --- a/src/Distribution/Server/Util/CountingMap.hs +++ b/src/Distribution/Server/Util/CountingMap.hs @@ -37,12 +37,12 @@ data NestedCountingMap a b = NCM { nestedTotalCount :: !Int , nestedCountingMap :: !(Map a b) } - deriving (Show, Eq, Ord, Typeable) + deriving (Show, Eq, Ord) newtype SimpleCountingMap a = SCM { simpleCountingMap :: NestedCountingMap a Int } - deriving (Show, Eq, Ord, Typeable) + deriving (Show, Eq, Ord) class CountingMap k a | a -> k where cmEmpty :: a diff --git a/src/Distribution/Server/Util/Nonce.hs b/src/Distribution/Server/Util/Nonce.hs index 91440a884..d37d81e92 100644 --- a/src/Distribution/Server/Util/Nonce.hs +++ b/src/Distribution/Server/Util/Nonce.hs @@ -14,14 +14,13 @@ import Distribution.Server.Framework.MemSize import Data.ByteString (ByteString) import Data.SafeCopy (base, extension, deriveSafeCopy, Migrate(..)) -import Data.Typeable import System.IO import qualified Data.ByteString.Base16 as Base16 import qualified Data.ByteString.Char8 as BS -- Only used for ASCII data import qualified Data.Char as Char newtype Nonce = Nonce ByteString - deriving (Eq, Ord, Show, Typeable, MemSize) + deriving (Eq, Ord, Show, MemSize) newRandomNonce :: Int -> IO Nonce newRandomNonce len = @@ -46,7 +45,7 @@ parseNonceM = either fail return . parseNonce -- | Nonce and Nonce_v0 have the same type, but the "new" nonce is -- internally NOT base16 encoded newtype Nonce_v0 = Nonce_v0 ByteString - deriving (Eq, Ord, Show, Typeable, MemSize) + deriving (Eq, Ord, Show, MemSize) $(deriveSafeCopy 0 'base ''Nonce_v0) diff --git a/src/Distribution/Server/Util/TarIndex.hs b/src/Distribution/Server/Util/TarIndex.hs index dd9cabfde..2c2a94e02 100644 --- a/src/Distribution/Server/Util/TarIndex.hs +++ b/src/Distribution/Server/Util/TarIndex.hs @@ -19,7 +19,7 @@ import Data.TarIndex (TarIndex) import Distribution.Server.Framework.BlobStorage (BlobId) data TarIndexMap = M {indexMap :: Map.Map BlobId TarIndex} - deriving (Typeable, Show) + deriving (Show) addIndex :: BlobId -> TarIndex -> Update TarIndexMap () addIndex blob index = modify $ insertTarIndex blob index