summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-04-13 09:23:39 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-04-13 09:26:45 +0100
commit87078efd7d517a69f6737b4c40a73c063684c5cf (patch)
treec99fe5afbd4c2d5fa9513464a336a26d76886a4d
parentfbb27d77b9c707008344f4c49fbb8d1015efb739 (diff)
downloadhaskell-87078efd7d517a69f6737b4c40a73c063684c5cf.tar.gz
Comments only in Type.isPredTy
-rw-r--r--compiler/types/Type.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index 56fa938257..0b01f1db39 100644
--- a/compiler/types/Type.hs
+++ b/compiler/types/Type.hs
@@ -1662,6 +1662,7 @@ isPredTy ty = go ty []
--
-- 1. There is actually a kind error. Example in which this showed up:
-- polykinds/T11399
+ --
-- 2. A type constructor application appears to be oversaturated. An
-- example of this occurred in GHC Trac #13187:
--
@@ -1669,11 +1670,14 @@ isPredTy ty = go ty []
-- type Const a b = b
-- f :: Const Int (,) Bool Char -> Char
--
- -- This code is actually fine, since Const is polymorphic in its
- -- return kind. It does show that isPredTy could possibly report a
- -- false negative if a constraint is similarly oversaturated, but
+ -- We call isPredTy (Const k1 k2 Int (,) Bool Char
+ -- where k1,k2 are unification variables that have been
+ -- unified to *, and (*->*->*) resp, /but not zonked/.
+ -- This shows that isPredTy can report a false negative
+ -- if a constraint is similarly oversaturated, but
-- it's hard to do better than isPredTy currently does without
- -- zonking, so we punt on such cases for now.
+ -- zonking, so we punt on such cases for now. This only happens
+ -- during debug-printing, so it doesn't matter.
isClassPred, isEqPred, isNomEqPred, isIPPred :: PredType -> Bool
isClassPred ty = case tyConAppTyCon_maybe ty of