@@ -44,7 +44,7 @@ instance Monoid Usage where
4444 mempty = Usage mempty mempty
4545
4646toErrPos :: Text -> VarUsage -> Maybe (J. Range , Text )
47- toErrPos code (VarUsage (LV loc v) scope) = do
47+ toErrPos code (VarUsage (Loc loc v) scope) = do
4848 -- A leading underscore will suppress the unused variable warning
4949 guard $ not $ " _" `T.isPrefixOf` v
5050 rangePair <- case loc of
@@ -78,12 +78,12 @@ checkOccurrences ::
7878 BindingType ->
7979 [Syntax ] ->
8080 Usage
81- checkOccurrences bindings lv @ ( LV loc v) declType childSyntaxes =
81+ checkOccurrences bindings lc @ ( Loc loc v) declType childSyntaxes =
8282 Usage childUsages $ missing <> deeperMissing
8383 where
8484 deeperBindings = M. insertWith (<>) v (pure loc) bindings
8585 Usage childUsages deeperMissing = mconcat $ map (getUsage deeperBindings) childSyntaxes
86- missing = [VarUsage lv declType | lv `S.notMember` childUsages]
86+ missing = [VarUsage lc declType | lc `S.notMember` childUsages]
8787
8888-- | Build up the bindings map as a function argument as
8989-- we descend into the syntax tree.
@@ -97,7 +97,7 @@ getUsage bindings (CSyntax _pos t _comments) = case t of
9797 where
9898 myUsages = case M. lookup v bindings of
9999 Nothing -> mempty
100- Just (loc :| _) -> S. singleton $ LV loc v
100+ Just (loc :| _) -> S. singleton $ Loc loc v
101101 SLam v _ s -> checkOccurrences bindings v Lambda [s]
102102 SApp s1 s2 -> getUsage bindings s1 <> getUsage bindings s2
103103 -- Warn on unused 'let' bindings...
@@ -110,7 +110,7 @@ getUsage bindings (CSyntax _pos t _comments) = case t of
110110 Just v -> checkOccurrences bindings v Bind [s1, s2]
111111 Nothing -> getUsage bindings s1 <> getUsage bindings s2
112112 SDelay s -> getUsage bindings s
113- SRcd m -> foldMap (\ (LV _ x, mt) -> maybe (getUsage bindings (STerm (TVar x))) (getUsage bindings) mt) m
113+ SRcd m -> foldMap (\ (Loc _ x, mt) -> maybe (getUsage bindings (STerm (TVar x))) (getUsage bindings) mt) m
114114 SProj s _ -> getUsage bindings s
115115 SAnnotate s _ -> getUsage bindings s
116116 SSuspend s -> getUsage bindings s
0 commit comments