Unused definitions across modules in a package

Hey! GHC warns me about unused definitions in a module. However, is it possible to warn me about unused definitions in a package? For example, suppose that module A exports function f and that module B uses A.f (everything on a single package). However, after some time B stops using A.f. Is there a way of receiving a warning saying that "A exports f but no other module uses it."? (I know that this warning wouldn't be useful for libraries, since their whole point is to export things.) Cheers! -- Felipe.

On 21 February 2013 08:56, Felipe Almeida Lessa
Hey!
GHC warns me about unused definitions in a module. However, is it possible to warn me about unused definitions in a package?
For example, suppose that module A exports function f and that module B uses A.f (everything on a single package). However, after some time B stops using A.f. Is there a way of receiving a warning saying that "A exports f but no other module uses it."?
(I know that this warning wouldn't be useful for libraries, since their whole point is to export things.)
My (getting-long-in-the-tooth-and-could-do-with-a-rewrite) SourceGraph package does identify these definitions. As for GHC warning about it, I wonder if maybe that's a better role for Cabal as it knows which modules are public vs private (and even libraries can have exported definitions that aren't used from non-exported modules).
Cheers!
-- Felipe.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

On Wed, Feb 20, 2013 at 9:20 PM, Ivan Lazar Miljenovic
My (getting-long-in-the-tooth-and-could-do-with-a-rewrite) SourceGraph package does identify these definitions.
What a coincidence, then! I was trying to use SourceGraph for other reasons but it didn't work for my codebase. I haven't investigated with it couldn't parse the files, though, and I use many extensions. Nice to know that it supports this feature =). Cheers, -- Felipe.
participants (2)
-
Felipe Almeida Lessa
-
Ivan Lazar Miljenovic