om-plugin-imports: Plugin-based explicit import generation.

[ compiler-plugin, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.2.0.0, 0.2.0.0.9.6, 0.3.0.0, 0.3.0.0.9.6, 0.3.0.0.9.10, 0.4.0.0.9.6, 0.4.0.0.9.8, 0.4.0.0.9.10
Dependencies base (>=4.19.0.0 && <4.21), containers (>=0.6.8 && <0.8), ghc (>=9.8.1 && <9.11), safe (>=0.3.19 && <0.4) [details]
License MIT
Copyright 2022 Rick Owens
Author Rick Owens
Maintainer rick@owensmurray.com
Category Compiler Plugin
Home page https://github.com/owensmurray/om-plugin-imports
Uploaded by rickowens at 2024-08-31T23:40:01Z
Distributions
Downloads 459 total (34 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for om-plugin-imports-0.4.0.0.9.10

[back to package description]

om-plugin-imports

This plugin behaves similarly to the native GHC options -ddump-minimal-imports. It will dump a file of the form <src-file>.full-imports. E.g. if the Haskell file was src/Foo/Bar.hs, then the dump file will be src/Foo/Bar.hs.full-imports. The file will contain a set of imports which can be copy/pasted over the imports in your module in a way that satisfies -Wmissing-import-lists.

Motivation

This is almost what -ddump-minimal-imports does, but -ddump-minimal-imports has the following deficiencies:

  • It will not always produce output that satisfies -Wmissing-import-lists. E.g. it will sometimes produce something like:

    import Foo (Bar(..))
    
  • It will explicitly import all the names from modules which are already qualified, E.g:

    import qualified Foo as F (foo, bar, baz)
    

Options

The plugin supports the following option:

  • excessive: Output the import list even on unambiguous qualified imports.