[commit: ghc] master: Add utility function isHoleName. (1224bb5)
git at git.haskell.org
git at git.haskell.org
Tue Jul 21 23:49:04 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/1224bb55cac502fe04005345aad47a6bc5c4a297/ghc
>---------------------------------------------------------------
commit 1224bb55cac502fe04005345aad47a6bc5c4a297
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Tue Jul 21 16:15:32 2015 -0700
Add utility function isHoleName.
Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
>---------------------------------------------------------------
1224bb55cac502fe04005345aad47a6bc5c4a297
compiler/basicTypes/Name.hs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compiler/basicTypes/Name.hs b/compiler/basicTypes/Name.hs
index 88b6e68..ce8619a 100644
--- a/compiler/basicTypes/Name.hs
+++ b/compiler/basicTypes/Name.hs
@@ -60,6 +60,7 @@ module Name (
isTyVarName, isTyConName, isDataConName,
isValName, isVarName,
isWiredInName, isBuiltInSyntax,
+ isHoleName,
wiredInNameTyThing_maybe,
nameIsLocalOrFrom, nameIsHomePackageImport, nameIsFromExternalPackage,
stableNameCmp,
@@ -212,6 +213,9 @@ isExternalName _ = False
isInternalName name = not (isExternalName name)
+isHoleName :: Name -> Bool
+isHoleName = isHoleModule . nameModule
+
nameModule name = nameModule_maybe name `orElse` pprPanic "nameModule" (ppr name)
nameModule_maybe :: Name -> Maybe Module
nameModule_maybe (Name { n_sort = External mod}) = Just mod
More information about the ghc-commits
mailing list