GHC's notion of "unused" is broken in ways that are not trivial to fix. It's been on my wish list for ages...but it's not a very exciting problem to tackle.
Simon | -----Original Message----- | From: Feliks Kluzniak [mailto:[EMAIL PROTECTED]] | Sent: 15 May 2002 19:31 | To: [EMAIL PROTECTED] | Subject: bad check for "Defined but not used" | | | | Hello, | | It seems that the check for functions that are defined, but | not used does not ignore direct recursion (see below: there | is only one warning). | | I think this is not quite right. When I compile a module, I | would find it very helpful to get information about | "unreachable code", i.e., about functions that are not | accessible from any of the exported functions (or from "main" | for the main module). I don't really care whether a | disconnected part of the call graph contains cycles - what I | want to know is that it is disconnected. | | Am I missing something? | | Regards, | -- Feliks | | | --------------------- | module See () where | | foo :: Int -> Int | | foo n = n + 1 | | | fun :: Int -> Int | | fun 0 = 0 | | fun n = fun (n - 1) | | ----------------------- | ghc-5.02.3: chasing modules from: see.hs | Compiling See ( see.hs, ../GHC/see.o ) | | see.hs:5: Warning: Defined but not used: foo | --------------------- _______________________________________________ | Glasgow-haskell-bugs mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs | _______________________________________________ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs