From a05945bf7776e242bfd21bc1dc24af52c515c2e5 Mon Sep 17 00:00:00 2001 From: amesgen Date: Wed, 8 Dec 2021 15:58:59 +0100 Subject: [PATCH] Analyse top-level pattern bindings (#93) Fixes #92. --- src/Weeder.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Weeder.hs b/src/Weeder.hs index 44e0fc8..4775bcf 100644 --- a/src/Weeder.hs +++ b/src/Weeder.hs @@ -264,7 +264,8 @@ topLevelAnalysis n@Node{ nodeChildren } = do analyseBinding :: ( Alternative m, MonadState Analysis m ) => HieAST a -> m () analyseBinding n@Node{ nodeSpan, sourcedNodeInfo } = do - guard $ any (Set.member ("FunBind", "HsBindLR") . nodeAnnotations) $ getSourcedNodeInfo sourcedNodeInfo + let bindAnns = Set.fromList [("FunBind", "HsBindLR"), ("PatBind", "HsBindLR")] + guard $ any (not . Set.disjoint bindAnns . nodeAnnotations) $ getSourcedNodeInfo sourcedNodeInfo for_ ( findDeclarations n ) \d -> do define d nodeSpan