Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scripts to automatically manage imports or refactor modules

Does anyone know of tools to manage Haskell imports? Sometimes, I want to refactor things by moving them to another file, and a script to generate the minimal set of imports [for the new file] would be nice.

like image 457
gatoatigrado Avatar asked Jul 20 '11 02:07

gatoatigrado


2 Answers

GHC can tell you which imports are required; simply add the -fwarn-unused-imports flag.

like image 110
Daniel Wagner Avatar answered Oct 16 '22 14:10

Daniel Wagner


There's a program called fix-imports that can generate a minimal set of imports for you. It only works for qualified imports, though.

like image 25
Heinrich Apfelmus Avatar answered Oct 16 '22 14:10

Heinrich Apfelmus