Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 379
    • Merge Requests 379
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10117

Closed
Open
Opened Feb 26, 2015 by Simon Peyton Jones@simonpjDeveloper

Change the scheme for reporting redundant imports

The current scheme for reporting redundant imports is given on the unusedimportspage.

The 7.10 migration page describes a hack to avoid redundant-import warnings during migration, without using CPP. The hack works for

  module Foo (Int, Word, Monoid(..)) where

  import Data.Monoid
  import Data.Word
  import Prelude

(the hack is putting import Prelude at the bottom). To understand why, read the specification on the unusedimportspage.

But it fails for

  module Foo (Int, Word, Monoid(..)) where

  import Data.Monoid (Monoid(..))
  import Data.Word (Word)
  import Prelude

because the specification treats itemised imports like import Data.Word(Word) differently to "import all" imports.

The question: is there alternative spec (vs the one on the unusedimportspage) that would support the behaviour desired here, without having other undesirable consequences?

Trac metadata
Trac field Value
Version 7.8.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#10117