[Haskell-cafe] Unused definitions across modules in a package

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Thu Feb 21 01:20:47 CET 2013


On 21 February 2013 08:56, Felipe Almeida Lessa <felipe.lessa at gmail.com> wrote:
> 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list