Skip to content
Snippets Groups Projects
Commit 80586003 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski
Browse files

WIP on #18302

Culprit:

pickGREsModExp :: ModuleName -> [GlobalRdrElt] -> [(GlobalRdrElt,GlobalRdrElt)]
-- ^ Pick GREs that are in scope *both* qualified *and* unqualified
-- Return each GRE that is, as a pair
--    (qual_gre, unqual_gre)
-- These two GREs are the original GRE with imports filtered to express how
-- it is in scope qualified an unqualified respectively
--
-- Used only for the 'module M' item in export list;
--   see 'GHC.Tc.Gen.Export.exports_from_avail'
pickGREsModExp mod gres = mapMaybe (pickBothGRE mod) gres

pickBothGRE :: ModuleName -> GlobalRdrElt -> Maybe (GlobalRdrElt, GlobalRdrElt)
pickBothGRE mod gre@(GRE { gre_name = n })
  | isBuiltInSyntax n                = Nothing
  | Just gre1 <- pickQualGRE mod gre
  , Just gre2 <- pickUnqualGRE   gre = Just (gre1, gre2)
  | otherwise                        = Nothing
  where
        -- isBuiltInSyntax filter out names for built-in syntax They
        -- just clutter up the environment (esp tuples), and the
        -- parser will generate Exact RdrNames for them, so the
        -- cluttered envt is no use.  Really, it's only useful for
        -- GHC.Base and GHC.Tuple.
parent 8440b5fa
Branches wip/T21694a
No related tags found
No related merge requests found
Pipeline #24604 canceled
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment