Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit e9853c1

Browse files
committed
Avoid allocating a useless cell.
1 parent 2c28e53 commit e9853c1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

semantic-core/src/Analysis/FlowInsensitive.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ cacheTerm eval term = do
6767
result <- eval term
6868
result <$ modify (Cache . Map.insertWith (<>) term (Set.singleton (result :: a)) . unCache)
6969

70-
runHeap :: address -> StateC (Heap address a) m b -> m (Heap address a, b)
71-
runHeap addr m = runState (Map.singleton addr Set.empty) m
70+
runHeap :: StateC (Heap address a) m b -> m (Heap address a, b)
71+
runHeap m = runState (Map.empty) m
7272

7373
-- | Fold a collection by mapping each element onto an 'Alternative' action.
7474
foldMapA :: (Alternative m, Foldable t) => (b -> m a) -> t b -> m a

semantic-core/src/Analysis/ImportGraph.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ importGraph
6363
importGraph eval
6464
= run
6565
. runFresh
66-
. runHeap "__semantic_root"
66+
. runHeap
6767
. traverse (runFile eval)
6868

6969
runFile

semantic-core/src/Analysis/Typecheck.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ typecheckingFlowInsensitive
103103
typecheckingFlowInsensitive eval
104104
= run
105105
. runFresh
106-
. runHeap "__semantic_root"
106+
. runHeap
107107
. fmap (fmap (fmap (fmap generalize)))
108108
. traverse (runFile eval)
109109

0 commit comments

Comments
 (0)