imports: Generate code for importing directories automatically

[ development, library, mit ] [ Propose Tags ]

This module helps to automatically generate code for importing all the haskell files from directories.


For cabal inited project, we customize Setup.hs file to generate the importing code.


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"


Target.hs: (by header)

module Target where

#include "imports.header"

func = Export.funcFromSomeWhere

Target.hs: (by module)

module Target where

import qualified ImportAll

func = ImportAll.funcFromSomeWhere
Versions [faq],,,,
Dependencies base (==4.7.*), directory (==1.2.*), filepath (==1.3.*), mtl (==2.2.*) [details]
License MIT
Copyright Copyright (C) 2015 Cindy Wang (CindyLinz)
Author Cindy Wang (CindyLinz)
Maintainer Cindy Wang (CindyLinz) <>
Category Development
Home page
Uploaded by CindyLinz at Sat Jan 17 14:37:05 UTC 2015
Distributions NixOS:
Downloads 1852 total (76 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-01-17 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees