mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Swap the parameters to mlfp.
This commit is contained in:
parent
db040aea62
commit
93a47730ea
@ -120,12 +120,12 @@ fixCache ev' yield e = do
|
|||||||
store <- getStore
|
store <- getStore
|
||||||
roots <- askRoots
|
roots <- askRoots
|
||||||
let c = Configuration e roots env store :: Configuration (LocationFor v) t v
|
let c = Configuration e roots env store :: Configuration (LocationFor v) t v
|
||||||
pairs <- mlfp mempty (\ dollar -> do
|
pairs <- mlfp (\ dollar -> do
|
||||||
putCache (mempty :: Cache (LocationFor v) t v)
|
putCache (mempty :: Cache (LocationFor v) t v)
|
||||||
putStore store
|
putStore store
|
||||||
reset 0
|
reset 0
|
||||||
_ <- localCache (const dollar) (collect point (ev' yield e) :: m (Set.Set v))
|
_ <- localCache (const dollar) (collect point (ev' yield e) :: m (Set.Set v))
|
||||||
getCache)
|
getCache) mempty
|
||||||
asum . flip map (maybe [] toList (cacheLookup c pairs)) $ \ (value, store') -> do
|
asum . flip map (maybe [] toList (cacheLookup c pairs)) $ \ (value, store') -> do
|
||||||
putStore store'
|
putStore store'
|
||||||
pure value
|
pure value
|
||||||
@ -139,10 +139,10 @@ fixCache ev' yield e = do
|
|||||||
mlfp :: ( Eq a
|
mlfp :: ( Eq a
|
||||||
, Monad m
|
, Monad m
|
||||||
)
|
)
|
||||||
=> a
|
=> (a -> m a)
|
||||||
-> (a -> m a)
|
-> a
|
||||||
-> m a
|
-> m a
|
||||||
mlfp a f = loop a
|
mlfp f = loop
|
||||||
where loop x = do
|
where loop x = do
|
||||||
x' <- f x
|
x' <- f x
|
||||||
if x' == x then
|
if x' == x then
|
||||||
|
Loading…
Reference in New Issue
Block a user