mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Avoid allocating a useless cell.
This commit is contained in:
parent
2c28e536e9
commit
e9853c1a3f
@ -67,8 +67,8 @@ cacheTerm eval term = do
|
||||
result <- eval term
|
||||
result <$ modify (Cache . Map.insertWith (<>) term (Set.singleton (result :: a)) . unCache)
|
||||
|
||||
runHeap :: address -> StateC (Heap address a) m b -> m (Heap address a, b)
|
||||
runHeap addr m = runState (Map.singleton addr Set.empty) m
|
||||
runHeap :: StateC (Heap address a) m b -> m (Heap address a, b)
|
||||
runHeap m = runState (Map.empty) m
|
||||
|
||||
-- | Fold a collection by mapping each element onto an 'Alternative' action.
|
||||
foldMapA :: (Alternative m, Foldable t) => (b -> m a) -> t b -> m a
|
||||
|
@ -63,7 +63,7 @@ importGraph
|
||||
importGraph eval
|
||||
= run
|
||||
. runFresh
|
||||
. runHeap "__semantic_root"
|
||||
. runHeap
|
||||
. traverse (runFile eval)
|
||||
|
||||
runFile
|
||||
|
@ -103,7 +103,7 @@ typecheckingFlowInsensitive
|
||||
typecheckingFlowInsensitive eval
|
||||
= run
|
||||
. runFresh
|
||||
. runHeap "__semantic_root"
|
||||
. runHeap
|
||||
. fmap (fmap (fmap (fmap generalize)))
|
||||
. traverse (runFile eval)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user