autoexporter: Automatically re-export modules.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Autoexporter automatically re-exports modules.


[Skip to ReadMe]

Properties

Versions0.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.7, 1.1.9, 1.1.10, 1.1.11, 1.1.13
Change logCHANGELOG.markdown
Dependenciesautoexporter, base (>=4.9.0 && <4.12), Cabal (>=1.24.0 && <1.25 || >=2.0.1 && <2.3), directory (>=1.2.6 && <1.4), filepath (>=1.4.1 && <1.5) [details]
LicenseMIT
MaintainerTaylor Fausak
CategoryUtility
Home pagehttps://github.com/tfausak/autoexporter#readme
Bug trackerhttps://github.com/tfausak/autoexporter/issues
Source repositoryhead: git clone https://github.com/tfausak/autoexporter
Executablesautoexporter
UploadedSat Mar 17 16:25:41 UTC 2018 by fozworth

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for autoexporter-1.1.7

[back to package description]

Autoexporter

Version badge Build badge

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:

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