summaryrefslogtreecommitdiff
path: root/compiler/typecheck/FamInst.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-06-23 08:47:31 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-06-23 09:22:53 +0100
commit3e0af469c97d34bea92032d54d155afc65bd4b20 (patch)
tree63548506546b50bf1af78d82ba92340d77d42510 /compiler/typecheck/FamInst.hs
parent210a2e122ce3b7c56c780e4541b9f222abe7d2f7 (diff)
downloadhaskell-3e0af469c97d34bea92032d54d155afc65bd4b20.tar.gz
Give lookupGRE_Name a better API
lookupGRE_Name should return either zero or one GREs, never several. This is a consequence of INVARIANT 1 on GlobalRdrEnv. So it's better if it returns a Maybe; the panic on multiple results is put in one place, instead of being scattered or ignored. Just refactoring, no change in behaviour
Diffstat (limited to 'compiler/typecheck/FamInst.hs')
-rw-r--r--compiler/typecheck/FamInst.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 39cd1a5c84..434f1f3e60 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -322,7 +322,7 @@ tcTopNormaliseNewTypeTF_maybe faminsts rdr_env ty
(not (isAbstractTyCon tc) && all in_scope data_con_names)
where
data_con_names = map dataConName (tyConDataCons tc)
- in_scope dc = not $ null $ lookupGRE_Name rdr_env dc
+ in_scope dc = isJust (lookupGRE_Name rdr_env dc)
{-
************************************************************************