From: simonpj Date: Tue, 16 Dec 2003 16:17:49 +0000 (+0000) Subject: [project @ 2003-12-16 16:17:49 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~194 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=daacf054782f0a9c0187c0e3b64e7c05bd173f5d;p=ghc-hetmet.git [project @ 2003-12-16 16:17:49 by simonpj] Clarify warn-unused-bindings documention --- diff --git a/ghc/docs/users_guide/using.sgml b/ghc/docs/users_guide/using.sgml index fb5f6f6..2c8e1ca 100644 --- a/ghc/docs/users_guide/using.sgml +++ b/ghc/docs/users_guide/using.sgml @@ -940,6 +940,13 @@ f "2" = 2 Report any function definitions (and local bindings) which are unused. For top-level functions, the warning is only given if the binding is not exported. + A definition is regarded as "used" if (a) it is exported, or (b) it is + mentioned in the right hand side of another definition that is used, or (c) the + function it defines begins with an underscore. The last case provides a + way to suppress unused-binding warnings selectively. + Notice that a variable + is reported as unused even if it appears in the right-hand side of another + unused binding. @@ -950,8 +957,10 @@ f "2" = 2 unused imports, warning imports, unused - Report any objects that are explicitly imported but - never used. + Report any modules that are explicitly imported but + never used. However, the form import M() is + never reported as an unused import, because it is a useful idiom + for importing instance declarations, which are anonymous in Haskell.