From edb232e6763162db131baa450457e62ca762eab4 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 13 Oct 2003 10:41:43 +0000 Subject: [PATCH] [project @ 2003-10-13 10:41:43 by simonpj] Add idIsFrom --- ghc/compiler/basicTypes/Id.lhs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/basicTypes/Id.lhs b/ghc/compiler/basicTypes/Id.lhs index 3b36e58..3d2b4f6 100644 --- a/ghc/compiler/basicTypes/Id.lhs +++ b/ghc/compiler/basicTypes/Id.lhs @@ -30,8 +30,8 @@ module Id ( isPrimOpId, isPrimOpId_maybe, isFCallId, isFCallId_maybe, isDataConWorkId, isDataConWorkId_maybe, - isBottomingId, - hasNoBinding, + isBottomingId, idIsFrom, + hasNoBinding, -- Inline pragma stuff idInlinePragma, setInlinePragma, modifyInlinePragma, @@ -98,10 +98,11 @@ import qualified Demand ( Demand ) #endif import DataCon ( isUnboxedTupleCon ) import NewDemand ( Demand, StrictSig, topDmd, topSig, isBottomingSig ) -import Name ( Name, OccName, +import Name ( Name, OccName, nameIsLocalOrFrom, mkSystemName, mkSystemNameEncoded, mkInternalName, getOccName, getSrcLoc ) +import Module ( Module ) import OccName ( EncodedFS, mkWorkerOcc ) import PrimRep ( PrimRep ) import FieldLabel ( FieldLabel ) @@ -295,6 +296,9 @@ isImplicitId id -- The dfun id is not an implicit Id; it must *not* be omitted, because -- it carries version info for the instance decl other -> False + +idIsFrom :: Module -> Id -> Bool +idIsFrom mod id = nameIsLocalOrFrom mod (idName id) \end{code} \begin{code} -- 1.7.10.4