The latest version of imports is 0.2.0.0-0.

imports

Version 0.1.2.0 revision 0 uploaded by CindyLinz.

Package meta

Synopsis
Generate code for importing directories automatically
Description

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 from Simple to Custom.

  • Then modify the main function in Setup.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
Author
Cindy Wang (CindyLinz)
Bug reports
n/a
Category
Development
Copyright
Copyright (C) 2015 Cindy Wang (CindyLinz)
Homepage
https://github.com/CindyLinz/Haskell-imports
Maintainer
Cindy Wang (CindyLinz) <cindylinz@gmail.com>
Package URL
n/a
Stability
n/a

Components