summaryrefslogtreecommitdiff
path: root/compiler/utils/Outputable.hs
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-12-11 15:58:56 +0000
committerRichard Eisenberg <rae@richarde.dev>2020-01-09 09:46:34 +0000
commitf05f75bff70180e979b7e98db7a3c0cb1a093765 (patch)
tree00f3b8dfb683f8d35440fea58163d5e98f3fd2f6 /compiler/utils/Outputable.hs
parent923a127205dd60147453f4420614efd1be29f070 (diff)
downloadhaskell-wip/t16775.tar.gz
Don't zap to Any; error insteadwip/t16775
This changes GHC's treatment of so-called Naughty Quantification Candidates to issue errors, instead of zapping to Any. Close #16775. No new test cases, because existing ones cover this well.
Diffstat (limited to 'compiler/utils/Outputable.hs')
-rw-r--r--compiler/utils/Outputable.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index d81c754866..02805c6c7c 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -34,7 +34,7 @@ module Outputable (
sep, cat,
fsep, fcat,
hang, hangNotEmpty, punctuate, ppWhen, ppUnless,
- speakNth, speakN, speakNOf, plural, isOrAre, doOrDoes,
+ speakNth, speakN, speakNOf, plural, isOrAre, doOrDoes, itsOrTheir,
unicodeSyntax,
coloured, keyword,
@@ -1160,6 +1160,15 @@ doOrDoes :: [a] -> SDoc
doOrDoes [_] = text "does"
doOrDoes _ = text "do"
+-- | Determines the form of possessive appropriate for the length of a list:
+--
+-- > itsOrTheir [x] = text "its"
+-- > itsOrTheir [x,y] = text "their"
+-- > itsOrTheir [] = text "their" -- probably avoid this
+itsOrTheir :: [a] -> SDoc
+itsOrTheir [_] = text "its"
+itsOrTheir _ = text "their"
+
{-
************************************************************************
* *