autoexporter: Automatically re-export modules.

[ library, mit, program, utility ] [ Propose Tags ]

Autoexporter automatically re-exports modules.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
pedantic

Enables -Werror, which turns warnings into errors.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.1, 0.1.2, 0.1.4, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.7, 1.1.9, 1.1.10, 1.1.11, 1.1.13, 1.1.14, 1.1.15, 1.1.16, 1.1.17, 1.1.18, 1.1.19, 1.1.20, 2.0.0.1, 2.0.0.2, 2.0.0.3, 2.0.0.4, 2.0.0.5, 2.0.0.6, 2.0.0.7, 2.0.0.8, 2.0.0.9, 2.0.0.10, 2.0.0.11, 2.0.0.12 (info)
Change log CHANGELOG.md
Dependencies autoexporter, base (>=4.18.0.0 && <4.19 || >=4.19.0.0 && <4.20 || >=4.20.0.0 && <4.21), Cabal-syntax (>=3.10.1.0 && <3.11 || >=3.12.0.0 && <3.13), directory (>=1.3.8.1 && <1.4), filepath (>=1.4.100.1 && <1.5 || >=1.5.2.0 && <1.6) [details]
License MIT
Author
Maintainer Taylor Fausak
Category Utility
Source repo head: git clone https://github.com/tfausak/autoexporter
Uploaded by fozworth at 2024-05-18T13:51:32Z
Distributions LTSHaskell:2.0.0.12, NixOS:2.0.0.12, Stackage:2.0.0.12
Reverse Dependencies 4 direct, 1 indirect [details]
Executables autoexporter
Downloads 20601 total (77 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-05-18 [all 1 reports]

Readme for autoexporter-2.0.0.12

[back to package description]

Autoexporter

CI Hackage

Autoexporter automatically re-exports Haskell modules.

Let's say you have a module M that just exports some other modules. It might look like this:

module M
  ( module M.A
  , module M.B
  ) where

import M.A
import M.B

This code is error-prone. If you add a new module, say M.C, you have to remember to come back to this file and re-export it. And this code is tedious to write. You have to list each module twice. You can do a little better, but not much.

module M (module X) where
import M.A as X
import M.B as X

Now you don't have to write every module twice, but you still have to remember to re-export everything. And the generated documentation for this module doesn't include anything about the exported modules.

Autoexporter handles this for you. Instead of either of the above approaches, simply drop this into the M module:

{-# OPTIONS_GHC -F -pgmF autoexporter #-}

That will generate code that looks like this:

module M (
  module M.A,
  module M.B,
) where
import M.A
import M.B

Autoexporter will generally behave as you'd expect, but there are a couple things to look out for:

  • You cannot selectively include or exclude any modules.

  • By default, only immediate children will be re-exported. If you use this in some module M, it won't pull in M.A.B. If you need deep re-exporting, please pass --deep to Autoexporter like this:

    {-# OPTIONS_GHC -F -pgmF autoexporter -optF --deep #-}