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.
Use ghc's -ddump-minimal-imports
flag. For an example, see Cleaning up your Haskell imports on my blog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With