summaryrefslogtreecommitdiff
path: root/compiler/Language
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-09-28 15:30:13 +0530
committerZubin <zubin.duggal@gmail.com>2021-11-20 17:39:25 +0000
commitbc7e9f038112496c45aeb81d1504e57acb3722c7 (patch)
treef69c0cf46a8c34f8ac00f77d59187afbf5d8444d /compiler/Language
parentb2933ea95273f11b05f7ff796a9646a2e912d7fc (diff)
downloadhaskell-bc7e9f038112496c45aeb81d1504e57acb3722c7.tar.gz
Use 'NonEmpty' for the fields in an 'HsProjection' (#20389)
T12545 is very inconsistently affected by this change for some reason. There is a decrease in allocations on most configurations, but an increase on validate-x86_64-linux-deb9-unreg-hadrian. Accepting it as it seems unrelated to this patch. Metric Decrease: T12545 Metric Increase: T12545
Diffstat (limited to 'compiler/Language')
-rw-r--r--compiler/Language/Haskell/Syntax/Expr.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs
index b472ac9589..16e0e4d2e5 100644
--- a/compiler/Language/Haskell/Syntax/Expr.hs
+++ b/compiler/Language/Haskell/Syntax/Expr.hs
@@ -50,6 +50,8 @@ import GHC.Core.Type
import Data.Data hiding (Fixity(..))
import qualified Data.Data as Data (Fixity(..))
+import Data.List.NonEmpty ( NonEmpty )
+
import GHCi.RemoteTypes ( ForeignRef )
import qualified Language.Haskell.TH as TH (Q)
@@ -555,7 +557,7 @@ data HsExpr p
-- For details on above see note [exact print annotations] in GHC.Parser.Annotation
| HsProjection {
proj_ext :: XProjection p
- , proj_flds :: [XRec p (DotFieldOcc p)]
+ , proj_flds :: NonEmpty (XRec p (DotFieldOcc p))
}
-- | Expression with an explicit type signature. @e :: type@