Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if import is redundant

Tags:

haskell

Is there a way to parse haskell source and for given import check if it is redundant?

haskell-src should be useful, but I've found nothing similar here.

like image 873
ДМИТРИЙ МАЛИКОВ Avatar asked Jul 28 '13 01:07

ДМИТРИЙ МАЛИКОВ


1 Answers

There is a nice new package called module-management that has the functionality you need. It has a cleanImports function that does exactly what it sounds like. It also has a bunch of other facilities for managing modules that may be useful.

The main problem I see--not having used the package myself--is that the cleanImports function does quite a bit all at once. If you want functions at a higher granularity, you will either have to look through other parts of the package or maybe even factor out some basic functionality yourself. That said, I think this package is the perfect place to start.

like image 182
Tikhon Jelvis Avatar answered Sep 20 '22 15:09

Tikhon Jelvis