diff --git a/semantic-core/src/Analysis/FlowInsensitive.hs b/semantic-core/src/Analysis/FlowInsensitive.hs index 2658e295f..f5198907f 100644 --- a/semantic-core/src/Analysis/FlowInsensitive.hs +++ b/semantic-core/src/Analysis/FlowInsensitive.hs @@ -65,8 +65,8 @@ cacheTerm eval term = do result <- eval term result <$ modify (Map.insertWith (<>) term (Set.singleton (result :: a))) -runHeap :: name -> StateC (Heap name a) m b -> m (Heap name a, b) -runHeap addr m = runState (Map.singleton addr Set.empty) m +runHeap :: StateC (Heap name a) m b -> m (Heap name 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 diff --git a/semantic-core/src/Analysis/ImportGraph.hs b/semantic-core/src/Analysis/ImportGraph.hs index 115238cab..89a0db10a 100644 --- a/semantic-core/src/Analysis/ImportGraph.hs +++ b/semantic-core/src/Analysis/ImportGraph.hs @@ -52,7 +52,7 @@ importGraph :: [File (Term Core.Core User)] -> (Heap User Value, [File (Either ( importGraph = run . runFresh - . runHeap "__semantic_root" + . runHeap . traverse runFile runFile :: ( Carrier sig m diff --git a/semantic-core/src/Analysis/ScopeGraph.hs b/semantic-core/src/Analysis/ScopeGraph.hs index 04ba00f5a..f3df06363 100644 --- a/semantic-core/src/Analysis/ScopeGraph.hs +++ b/semantic-core/src/Analysis/ScopeGraph.hs @@ -58,7 +58,7 @@ scopeGraph :: [File (Term Core.Core User)] -> (Heap User Value, [File (Either (L scopeGraph = run . runFresh - . runHeap "__semantic_root" + . runHeap . traverse runFile runFile diff --git a/semantic-core/src/Analysis/Typecheck.hs b/semantic-core/src/Analysis/Typecheck.hs index b007bf180..881fc97c4 100644 --- a/semantic-core/src/Analysis/Typecheck.hs +++ b/semantic-core/src/Analysis/Typecheck.hs @@ -90,7 +90,7 @@ typecheckingFlowInsensitive :: [File (Term Core.Core User)] -> (Heap User (Term typecheckingFlowInsensitive = run . runFresh - . runHeap "__semantic_root" + . runHeap . fmap (fmap (fmap (fmap generalize))) . traverse runFile