Commit d71b65f5 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

holePackageKey and isHoleModule utility functions.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 8800a73a
...@@ -42,6 +42,7 @@ module Module ...@@ -42,6 +42,7 @@ module Module
dphParPackageKey, dphParPackageKey,
mainPackageKey, mainPackageKey,
thisGhcPackageKey, thisGhcPackageKey,
holePackageKey, isHoleModule,
interactivePackageKey, isInteractiveModule, interactivePackageKey, isInteractiveModule,
wiredInPackageKeys, wiredInPackageKeys,
...@@ -399,9 +400,17 @@ interactivePackageKey = fsToPackageKey (fsLit "interactive") ...@@ -399,9 +400,17 @@ interactivePackageKey = fsToPackageKey (fsLit "interactive")
-- to symbol names, since there can be only one main package per program. -- to symbol names, since there can be only one main package per program.
mainPackageKey = fsToPackageKey (fsLit "main") mainPackageKey = fsToPackageKey (fsLit "main")
-- | This is a fake package id used to provide identities to any un-implemented
-- signatures. The set of hole identities is global over an entire compilation.
holePackageKey :: PackageKey
holePackageKey = fsToPackageKey (fsLit "hole")
isInteractiveModule :: Module -> Bool isInteractiveModule :: Module -> Bool
isInteractiveModule mod = modulePackageKey mod == interactivePackageKey isInteractiveModule mod = modulePackageKey mod == interactivePackageKey
isHoleModule :: Module -> Bool
isHoleModule mod = modulePackageKey mod == holePackageKey
wiredInPackageKeys :: [PackageKey] wiredInPackageKeys :: [PackageKey]
wiredInPackageKeys = [ primPackageKey, wiredInPackageKeys = [ primPackageKey,
integerPackageKey, integerPackageKey,
......
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