diff options
author | Zubin Duggal <zubin.duggal@gmail.com> | 2021-09-28 15:30:13 +0530 |
---|---|---|
committer | Zubin <zubin.duggal@gmail.com> | 2021-11-20 17:39:25 +0000 |
commit | bc7e9f038112496c45aeb81d1504e57acb3722c7 (patch) | |
tree | f69c0cf46a8c34f8ac00f77d59187afbf5d8444d /utils | |
parent | b2933ea95273f11b05f7ff796a9646a2e912d7fc (diff) | |
download | haskell-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 'utils')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index 44cadff4c1..8e9d84067f 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -43,6 +43,7 @@ import Data.Data ( Data ) import Data.Foldable import Data.Typeable import Data.List ( partition, sort, sortBy) +import Data.List.NonEmpty ( NonEmpty ) import Data.Maybe ( isJust ) import Data.Void @@ -382,6 +383,10 @@ instance (ExactPrint a) => ExactPrint [a] where getAnnotationEntry = const NoEntryVal exact ls = mapM_ markAnnotated ls +instance (ExactPrint a) => ExactPrint (NonEmpty a) where + getAnnotationEntry = const NoEntryVal + exact ls = mapM_ markAnnotated ls + instance (ExactPrint a) => ExactPrint (Maybe a) where getAnnotationEntry = const NoEntryVal exact Nothing = return () |