[commit: ghc] master: Comments only in Type.isPredTy (87078ef)
git at git.haskell.org
git at git.haskell.org
Thu Apr 13 08:27:18 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/87078efd7d517a69f6737b4c40a73c063684c5cf/ghc
>---------------------------------------------------------------
commit 87078efd7d517a69f6737b4c40a73c063684c5cf
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Apr 13 09:23:39 2017 +0100
Comments only in Type.isPredTy
>---------------------------------------------------------------
87078efd7d517a69f6737b4c40a73c063684c5cf
compiler/types/Type.hs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index 56fa938..0b01f1d 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
More information about the ghc-commits
mailing list