mirror of
https://github.com/github/semantic.git
synced 2024-12-27 00:44:57 +03:00
Surface the precise heap through a State effect.
This commit is contained in:
parent
8f50312be3
commit
327208eb15
@ -22,7 +22,7 @@ newtype HeapC value m a = HeapC (StateC (IntMap.IntMap value) m a)
|
||||
deriving (Applicative, Functor, Monad, Fail.MonadFail)
|
||||
|
||||
instance (Carrier sig m, Effect sig)
|
||||
=> Carrier (Heap Precise value :+: sig) (HeapC value m) where
|
||||
=> Carrier (Heap Precise value :+: State (IntMap.IntMap value) :+: sig) (HeapC value m) where
|
||||
eff (L (Deref addr k)) = HeapC (gets (IntMap.lookup addr)) >>= k
|
||||
eff (L (Assign addr value k)) = HeapC (modify (IntMap.insert addr value)) >> k
|
||||
eff (R other) = HeapC (eff (R (handleCoercible other)))
|
||||
eff (R other) = HeapC (eff (handleCoercible other))
|
||||
|
Loading…
Reference in New Issue
Block a user