mirror of
https://github.com/github/semantic.git
synced 2024-12-14 08:25:32 +03:00
Define CurrentFrame/Scope newtypes.
This commit is contained in:
parent
74ca31af53
commit
04e2ca5321
@ -17,6 +17,7 @@ module Control.Abstract.Heap
|
||||
, deref
|
||||
, assign
|
||||
, newFrame
|
||||
, CurrentFrame(..)
|
||||
, currentFrame
|
||||
, withScopeAndFrame
|
||||
, withLexicalScopeAndFrame
|
||||
@ -122,6 +123,8 @@ putHeap = put
|
||||
modifyHeap :: (Member (State (Heap address address value)) sig, Carrier sig m) => (Heap address address value -> Heap address address value) -> Evaluator term address value m ()
|
||||
modifyHeap = modify
|
||||
|
||||
newtype CurrentFrame address = CurrentFrame { unCurrentFrame :: address }
|
||||
|
||||
-- | Retrieve the heap.
|
||||
currentFrame :: ( Carrier sig m
|
||||
, Member (Reader (address, address)) sig
|
||||
|
@ -10,6 +10,7 @@ module Control.Abstract.ScopeGraph
|
||||
, ScopeError(..)
|
||||
, Reference(..)
|
||||
, EdgeLabel(..)
|
||||
, CurrentScope(..)
|
||||
, currentScope
|
||||
, insertExportEdge
|
||||
, insertImportEdge
|
||||
@ -126,6 +127,8 @@ newScope edges = do
|
||||
address <- alloc name
|
||||
address <$ modify (ScopeGraph.newScope address edges)
|
||||
|
||||
newtype CurrentScope address = CurrentScope { unCurrentScope :: address }
|
||||
|
||||
currentScope :: forall address sig term value m. ( Member (Reader (address, address)) sig
|
||||
, Carrier sig m
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user