From: simonpj Date: Mon, 13 Oct 2003 10:41:43 +0000 (+0000) Subject: [project @ 2003-10-13 10:41:43 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~366 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=edb232e6763162db131baa450457e62ca762eab4;p=ghc-hetmet.git [project @ 2003-10-13 10:41:43 by simonpj] Add idIsFrom --- 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}