+
+tcLookupLocalIds :: [Name] -> NF_TcM [TcId]
+tcLookupLocalIds ns
+ = tcGetEnv `thenNF_Tc` \ env ->
+ returnNF_Tc (map (lookup (tcLEnv env)) ns)
+ where
+ lookup lenv name = case lookupNameEnv lenv name of
+ Just (ATcId id) -> id
+ other -> pprPanic "tcLookupLocalIds" (ppr name)
+
+tcLookupSyntaxId :: Name -> NF_TcM Id
+-- Lookup a name like PrelNum.fromInt, and return the corresponding Id,
+-- after mapping through the SyntaxMap. This may give us the Id for
+-- (say) MyPrelude.fromInt
+tcLookupSyntaxId name
+ = tcGetEnv `thenNF_Tc` \ env ->
+ returnNF_Tc (case lookup_global env (tcSyntaxMap env name) of
+ Just (AnId id) -> id
+ other -> pprPanic "tcLookupSyntaxId" (ppr name))
+
+tcLookupSyntaxName :: Name -> NF_TcM Name
+tcLookupSyntaxName name
+ = tcGetEnv `thenNF_Tc` \ env ->
+ returnNF_Tc (tcSyntaxMap env name)