Skip to content
Browse files

Export a function to grab the local environment as a function.

  • Loading branch information...
1 parent f56db20 commit 59a91586963b8adbc03bbe8fc29fc71fac5c0989 lennart@augustsson.net committed Feb 4, 2007
Showing with 6 additions and 0 deletions.
  1. +6 −0 compiler/rename/RnEnv.lhs
View
6 compiler/rename/RnEnv.lhs
@@ -15,6 +15,7 @@ module RnEnv (
lookupLocatedInstDeclBndr,
lookupSyntaxName, lookupSyntaxTable, lookupImportedName,
lookupGreRn, lookupGreRn_maybe,
+ getLookupOccRn,
newLocalsRn, newIPNameRn,
bindLocalNames, bindLocalNamesFV,
@@ -255,6 +256,11 @@ lookupFamInstDeclBndr mod lrdr_name@(L _ rdr_name)
-- Occurrences
--------------------------------------------------
+getLookupOccRn :: RnM (Name -> Maybe Name)
+getLookupOccRn
+ = getLocalRdrEnv `thenM` \ local_env ->
+ return (lookupLocalRdrEnv local_env . mkRdrUnqual . nameOccName)
+
lookupLocatedOccRn :: Located RdrName -> RnM (Located Name)
lookupLocatedOccRn = wrapLocM lookupOccRn

0 comments on commit 59a9158

Please sign in to comment.
Something went wrong with that request. Please try again.