diff --git a/src/Control/Abstract/Heap.hs b/src/Control/Abstract/Heap.hs index 92b3779cc..9641c47fe 100644 --- a/src/Control/Abstract/Heap.hs +++ b/src/Control/Abstract/Heap.hs @@ -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 diff --git a/src/Control/Abstract/ScopeGraph.hs b/src/Control/Abstract/ScopeGraph.hs index 51fd32806..9a97bc939 100644 --- a/src/Control/Abstract/ScopeGraph.hs +++ b/src/Control/Abstract/ScopeGraph.hs @@ -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 )