Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell tool to rewrite import statements to name all imports?

Tags:

import

haskell

While writing Haskell code, I often simply type

import System.Environment
import System.Directory

Is there a tool available that will amend these import statements and add the function names I actually use back into the import statements? Such as:

import System.Environment (getArgs)
import System.Directory (getDirectoryContents)

Thanks.

like image 231
me2 Avatar asked Feb 01 '10 16:02

me2


1 Answers

Use ghc's -ddump-minimal-imports flag. For an example, see Cleaning up your Haskell imports on my blog.

like image 69
Greg Bacon Avatar answered Nov 02 '22 07:11

Greg Bacon