mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Simplify deref slightly.
This commit is contained in:
parent
0c106865f7
commit
16b1442b4b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user