You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm confused by the behaviour of weeder around re-exports. For example
B defines not_a_weed
A imports B and re-exports not_a_weed
A.not_a_weed is set as a root
Yet B.not_a_weed is detected as a weed. Is this expected behaviour? If so can I get the behaviour that I want? To put this in a more realistic context I want to use weeder on Opaleye by setting all functions in Opaleye (and a couple of other modules) to be roots.
This seems to be related to #40. In fact resolving that issue would probably solve my problem. But it seems that even without a feature to mark every export from a module as a root marking an individual re-export should mark its original definition as used.
--- weeder-example.cabal
cabal-version: 2.4
name: weeder-example
version: 0.1.0.0
library
exposed-modules: A, B
build-depends: base
hs-source-dirs: src
default-language: Haskell2010
--- cabal.project.local
package *
ghc-options: -fwrite-ide-info
--- weeder.dhall
-- To run it:
-- ~/.ghcup/bin/cabal clean && ~/.ghcup/bin/cabal build --with-ghc /opt/ghc/8.10.2/bin/ghc all && ~/.cabal/bin/weeder-8.10
{ roots = [ "^B.not_a_weed$" ]
, type-class-roots = True }
--- src/A.hs
module A where
not_a_weed :: Int
not_a_weed = 1
--- src/B.hs
module B (not_a_weed) where
import A
% ~/.cabal/bin/weeder-8.10
src/A.hs:4:1: error: not_a_weed is unused
2 ┃
3 ┃ not_a_weed :: Int
4 ┃ not_a_weed = 1
Delete this definition or add ‘A.not_a_weed’ as a root to fix this error.
Weeds detected: 1
The text was updated successfully, but these errors were encountered:
I'm confused by the behaviour of weeder around re-exports. For example
B
definesnot_a_weed
A
importsB
and re-exportsnot_a_weed
A.not_a_weed
is set as a rootYet
B.not_a_weed
is detected as a weed. Is this expected behaviour? If so can I get the behaviour that I want? To put this in a more realistic context I want to use weeder on Opaleye by setting all functions inOpaleye
(and a couple of other modules) to be roots.This seems to be related to #40. In fact resolving that issue would probably solve my problem. But it seems that even without a feature to mark every export from a module as a root marking an individual re-export should mark its original definition as used.
The text was updated successfully, but these errors were encountered: