mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Add lowerBound instance
This commit is contained in:
parent
82b6b7c52e
commit
8c917e3523
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user