summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-09-28 15:30:13 +0530
committerBen Gamari <ben@smart-cactus.org>2021-10-25 17:16:35 -0400
commitcb01e002505639abf5ef182a890c7c501e5978cf (patch)
tree79d15480755c202077e4d02441a9c06108ebc619 /utils
parent3d0111f276b60d8545fad04bbe158662c160d151 (diff)
downloadhaskell-cb01e002505639abf5ef182a890c7c501e5978cf.tar.gz
Use 'NonEmpty' for the fields in an 'HsProjection' (#20389)
(cherry picked from commit 63d4b83e14cdca01dc18b1b02b2ffb026d1df405)
Diffstat (limited to 'utils')
-rw-r--r--utils/check-exact/ExactPrint.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs
index 637ffe3b4a..067c50ae81 100644
--- a/utils/check-exact/ExactPrint.hs
+++ b/utils/check-exact/ExactPrint.hs
@@ -38,6 +38,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
@@ -370,6 +371,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 ()