Skip to content
  • Simon Peyton Jones's avatar
    Refactor the imports of InteractiveContext · 35d213ab
    Simon Peyton Jones authored
    Instead of two fields
       ic_toplev_scope :: [Module]
       ic_imports      :: [ImportDecl RdrName]
    
    we now just have one
       ic_imports :: [InteractiveImport]
    with the auxiliary data type
       data InteractiveImport
        = IIDecl (ImportDecl RdrName)  -- Bring the exports of a particular module
        	   	       		   -- (filtered by an import decl) into scope
    
        | IIModule Module	-- Bring into scope the entire top-level envt of
        	     		-- of this module, including the things imported
    			-- into it.
    
    This makes lots of code less confusing.  No change in behaviour.
    It's preparatory to fixing Trac #5147.
    
    While I was at I also
      * Cleaned up the handling of the "implicit" Prelude import
        by adding a ideclImplicit field to ImportDecl.  This
        significantly reduces plumbing in the handling of
        the implicit Prelude import
    
      * Used record notation consistently for ImportDecl
    35d213ab