1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Reformat the signature for reachable.

This commit is contained in:
Rob Rix 2017-12-21 14:25:22 -05:00
parent e4ae5d8c92
commit 2232e5b03e

View File

@ -37,7 +37,13 @@ gc :: ( Ord (LocationFor a)
gc roots store = storeRestrict store (reachable roots store) gc roots store = storeRestrict store (reachable roots store)
-- | Compute the set of addresses reachable from a given root set in a given store. -- | Compute the set of addresses reachable from a given root set in a given store.
reachable :: (Ord (LocationFor a), Foldable (Cell (LocationFor a)), ValueRoots (LocationFor a) a) => Live (LocationFor a) a -> Store (LocationFor a) a -> Live (LocationFor a) a reachable :: ( Ord (LocationFor a)
, Foldable (Cell (LocationFor a))
, ValueRoots (LocationFor a) a
)
=> Live (LocationFor a) a
-> Store (LocationFor a) a
-> Live (LocationFor a) a
reachable roots store = go roots mempty reachable roots store = go roots mempty
where go set seen = case liveSplit set of where go set seen = case liveSplit set of
Nothing -> seen Nothing -> seen