Skip to content

Commit b7cebc6

Browse files
committed
Use strict record fields and strict map in PackageInfoJSON
1 parent a73f029 commit b7cebc6

File tree

1 file changed

+9
-8
lines changed
  • Distribution/Server/Features/PackageInfoJSON

1 file changed

+9
-8
lines changed

Distribution/Server/Features/PackageInfoJSON/State.hs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE BangPatterns #-}
12
{-# LANGUAGE DeriveDataTypeable #-}
23
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE LambdaCase #-}
@@ -16,7 +17,7 @@ import qualified Data.Aeson as Aeson
1617
import Data.Aeson ((.=), (.:))
1718
import Data.Acid (Query, Update, makeAcidic)
1819
import qualified Data.HashMap.Strict as HashMap
19-
import qualified Data.Map as Map
20+
import qualified Data.Map.Strict as Map
2021
import Data.Monoid (Sum(..))
2122
import qualified Data.Text as T
2223
import qualified Data.Text.Encoding as T
@@ -45,13 +46,13 @@ import Distribution.Server.Framework.MemSize (MemSize,
4546
-- | Basic information about a package. These values are
4647
-- used in the `/package/:packagename` JSON endpoint
4748
data PackageBasicDescription = PackageBasicDescription
48-
{ pbd_license :: License
49-
, pbd_copyright :: T.Text
50-
, pbd_synopsis :: T.Text
51-
, pbd_description :: T.Text
52-
, pbd_author :: T.Text
53-
, pbd_homepage :: T.Text
54-
, pbd_metadata_revision :: Int
49+
{ pbd_license :: !License
50+
, pbd_copyright :: !T.Text
51+
, pbd_synopsis :: !T.Text
52+
, pbd_description :: !T.Text
53+
, pbd_author :: !T.Text
54+
, pbd_homepage :: !T.Text
55+
, pbd_metadata_revision :: !Int
5556
} deriving (Eq, Show, Generic)
5657

5758
instance SafeCopy PackageBasicDescription where

0 commit comments

Comments
 (0)