mirror of
https://github.com/github/semantic.git
synced 2024-11-24 17:04:47 +03:00
💄: $ for effect handler.
This commit is contained in:
parent
b491750f94
commit
ffd1e3e3f8
@ -113,9 +113,9 @@ data Store address value return where
|
||||
Deref :: address -> Store address value value
|
||||
|
||||
runStore :: (Addressable address effects, Member (Resumable (AddressError address value)) effects, Member (State (Heap address (Cell address) value)) effects) => Evaluator address value (Store address value ': effects) a -> Evaluator address value effects a
|
||||
runStore = interpret (\ eff -> case eff of
|
||||
runStore = interpret $ \ eff -> case eff of
|
||||
Alloc name -> allocCell name
|
||||
Deref addr -> heapLookup addr <$> get >>= maybeM (throwResumable (UnallocatedAddress addr)) >>= derefCell addr >>= maybeM (throwResumable (UninitializedAddress addr)))
|
||||
Deref addr -> heapLookup addr <$> get >>= maybeM (throwResumable (UnallocatedAddress addr)) >>= derefCell addr >>= maybeM (throwResumable (UninitializedAddress addr))
|
||||
|
||||
|
||||
data AddressError address value resume where
|
||||
|
Loading…
Reference in New Issue
Block a user