diff --git a/semantic-core/src/Analysis/ScopeGraph.hs b/semantic-core/src/Analysis/ScopeGraph.hs index 9f3ae68ab..88ddb6ad5 100644 --- a/semantic-core/src/Analysis/ScopeGraph.hs +++ b/semantic-core/src/Analysis/ScopeGraph.hs @@ -13,6 +13,7 @@ import Control.Effect.Carrier import Control.Effect.Fresh import Control.Effect.Reader import Control.Effect.State +import Control.Monad ((>=>)) import qualified Data.Core as Core import Data.File import Data.Foldable (fold) @@ -75,7 +76,7 @@ scopeGraphAnalysis = Analysis{..} loc <- ask @Loc local (Map.insert name loc) m lookupEnv = pure . Just - deref addr = gets (Map.lookup addr) >>= maybe (pure Nothing) (foldMapA (pure . Just)) . nonEmpty . maybe [] (Set.toList @ScopeGraph) + deref addr = gets (Map.lookup addr >=> nonEmpty . Set.toList) >>= maybe (pure Nothing) (foldMapA (pure . Just)) assign addr ty = modify (Map.insertWith (<>) addr (Set.singleton ty)) abstract eval name body = do addr <- alloc name