mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
📝 envRoots.
This commit is contained in:
parent
f26ef5a59a
commit
7f8755b748
@ -23,6 +23,9 @@ envInsert :: Name -> Address l a -> Environment l a -> Environment l a
|
|||||||
envInsert name value (Environment m) = Environment (Map.insert name value m)
|
envInsert name value (Environment m) = Environment (Map.insert name value m)
|
||||||
|
|
||||||
|
|
||||||
|
-- | Retrieve the 'Live' set of addresses to which the given free variable names are bound.
|
||||||
|
--
|
||||||
|
-- Unbound names are silently dropped.
|
||||||
envRoots :: (Ord l, Foldable t) => Environment l a -> t Name -> Live l a
|
envRoots :: (Ord l, Foldable t) => Environment l a -> t Name -> Live l a
|
||||||
envRoots env = foldr ((<>) . maybe mempty liveSingleton . flip envLookup env) mempty
|
envRoots env = foldr ((<>) . maybe mempty liveSingleton . flip envLookup env) mempty
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user