Commit 1224bb55 authored by Edward Z. Yang's avatar Edward Z. Yang

Add utility function isHoleName.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent a7e03266
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment