imports: Generate code for importing directories automatically
This module helps to automatically generate code for importing all the haskell files from directories.
Synopsis
For cabal inited project, we customize Setup.hs
file to generate the importing code.
Be sure to modify the
build-type
field in the.cabal
file fromSimple
toCustom
.Then modify the
main
function inSetup.hs
to generate importing code by either header file or a module file.
Setup.hs:
import Distribution.Simple import System.Imports (writeImportsHeader, writeImportsModule) main = do writeImportsHeader "imports.header" "Export" "Some.Where" "Some/Where" -- or writeImportsModule "ImportAll.hs" "ImportAll" "Some.Where" "Some/Where" defaultMain
Target.hs: (by header)
{-# LANGUAGE CPP #-} module Target where #include "imports.header" func = Export.funcFromSomeWhere
Target.hs: (by module)
module Target where import qualified ImportAll func = ImportAll.funcFromSomeWhere
Downloads
- imports-0.2.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.2.1, 0.2.0.0 |
---|---|
Dependencies | base (>=4.7 && <4.9), directory (>=1.2 && <1.3), filepath (>=1.4 && <1.5), mtl (>=2.2 && <2.3) [details] |
License | MIT |
Copyright | Copyright (C) 2015 Cindy Wang (CindyLinz) |
Author | Cindy Wang (CindyLinz) |
Maintainer | Cindy Wang (CindyLinz) <cindylinz@gmail.com> |
Category | Development |
Home page | https://github.com/CindyLinz/Haskell-imports |
Uploaded | by CindyLinz at 2016-01-21T08:48:39Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 3251 total (0 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 2016-01-21 [all 1 reports] |