1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00

Add lowerBound instance

This commit is contained in:
joshvera 2018-09-18 12:25:43 -04:00
parent 82b6b7c52e
commit 8c917e3523
2 changed files with 3 additions and 4 deletions

View File

@ -73,7 +73,7 @@ instance Effect (ScopeEnv address) where
runScopeEnv :: (Ord address, Effects effects, Member Fresh effects, Member (Allocator address) effects)
=> Evaluator address value (ScopeEnv address ': effects) a
-> Evaluator address value effects (ScopeGraph address, a)
runScopeEnv evaluator = runState ScopeGraph.emptyGraph (reinterpret handleScopeEnv evaluator)
runScopeEnv evaluator = runState lowerBound (reinterpret handleScopeEnv evaluator)
handleScopeEnv :: forall address value effects a. (Ord address, Member Fresh effects, Member (Allocator address) effects, Effects effects)
=> ScopeEnv address (Eff (ScopeEnv address ': effects)) a

View File

@ -18,7 +18,6 @@ module Data.Abstract.ScopeGraph
, scopeOfRef
, pathOfRef
, declare
, emptyGraph
, reference
, newScope
, associatedScope
@ -46,8 +45,8 @@ data Scope scopeAddress = Scope {
data ScopeGraph scope = ScopeGraph { graph :: Map scope (Scope scope), currentScope :: Maybe scope }
emptyGraph :: Ord scope => ScopeGraph scope
emptyGraph = ScopeGraph mempty Nothing
instance Ord scope => Lower (ScopeGraph scope) where
lowerBound = ScopeGraph mempty Nothing
deriving instance Eq address => Eq (ScopeGraph address)
deriving instance Show address => Show (ScopeGraph address)