summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data/FastString.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Data/FastString.hs')
-rw-r--r--compiler/GHC/Data/FastString.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index 655dd80005..33ceedd44c 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -1,6 +1,7 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
@@ -265,14 +266,12 @@ uniqCompareFS fs1 fs2 = compare (uniq fs1) (uniq fs2)
-- is not deterministic from one run to the other.
newtype NonDetFastString
= NonDetFastString FastString
- deriving (Eq,Data)
+ deriving newtype (Eq, Show)
+ deriving stock Data
instance Ord NonDetFastString where
compare (NonDetFastString fs1) (NonDetFastString fs2) = uniqCompareFS fs1 fs2
-instance Show NonDetFastString where
- show (NonDetFastString fs) = show fs
-
-- | Lexical FastString
--
-- This is a simple FastString wrapper with an Ord instance using
@@ -280,14 +279,12 @@ instance Show NonDetFastString where
-- representation). Hence it is deterministic from one run to the other.
newtype LexicalFastString
= LexicalFastString FastString
- deriving (Eq,Data)
+ deriving newtype (Eq, Show)
+ deriving stock Data
instance Ord LexicalFastString where
compare (LexicalFastString fs1) (LexicalFastString fs2) = lexicalCompareFS fs1 fs2
-instance Show LexicalFastString where
- show (LexicalFastString fs) = show fs
-
-- -----------------------------------------------------------------------------
-- Construction