1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 01:42:43 +03:00

whitespace changes

This commit is contained in:
Patrick Thomson 2018-06-29 16:00:23 -04:00
parent b63624ac41
commit bef406b5c7
3 changed files with 4 additions and 7 deletions

View File

@ -32,10 +32,7 @@ lookupCache :: (Cacheable term address (Cell address) value, Member (State (Cach
lookupCache configuration = cacheLookup configuration <$> get
-- | Run an action, caching its result and 'Heap' under the given configuration.
cachingConfiguration :: ( Cacheable term address (Cell address) value
, Member (State (Cache term address (Cell address) value)) effects
, Member (State (Heap address (Cell address) value)) effects
)
cachingConfiguration :: (Cacheable term address (Cell address) value, Member (State (Cache term address (Cell address) value)) effects, Member (State (Heap address (Cell address) value)) effects)
=> Configuration term address (Cell address) value
-> Set (Cached address (Cell address) value)
-> TermEvaluator term address value effects (ValueRef address)
@ -96,7 +93,7 @@ convergingModules recur m = do
c <- getConfiguration (subterm (moduleBody m))
-- Convergence here is predicated upon an Eq instance, not α-equivalence
cache <- converge lowerBound (\ prevCache -> isolateCache . raiseHandler locally $ do
TermEvaluator (putHeap (configurationHeap c))
TermEvaluator (putHeap (configurationHeap c))
-- We need to reset fresh generation so that this invocation converges.
resetFresh 0 $
-- This is subtle: though the calling context supports nondeterminism, we want
@ -118,7 +115,7 @@ converge :: (Eq a, Monad m)
converge seed f = loop seed
where loop x = do
x' <- f x
if x == x' then
if x' == x then
pure x
else
loop x'

View File

@ -32,5 +32,6 @@ cacheSet key value = Cache . Monoidal.insert key value . unCache
cacheInsert :: Cacheable term address cell value => Configuration term address cell value -> Cached address cell value -> Cache term address cell value -> Cache term address cell value
cacheInsert = curry cons
instance (Show term, Show address, Show (cell value), Show value) => Show (Cache term address cell value) where
showsPrec d = showsUnaryWith showsPrec "Cache" d . map (second toList) . Monoidal.pairs . unCache

View File

@ -39,7 +39,6 @@ formatName (I i) = Text.pack $ '_' : (alphabet !! a) : replicate n 'ʹ'
where alphabet = ['a'..'z']
(n, a) = i `divMod` length alphabet
-- $
-- >>> I 0
-- "_a"