mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Reformat the runStore signature.
This commit is contained in:
parent
ffd1e3e3f8
commit
eb40de097e
@ -112,7 +112,12 @@ data Store address value return where
|
||||
Alloc :: Name -> Store address value address
|
||||
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 :: ( 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
|
||||
Alloc name -> allocCell name
|
||||
Deref addr -> heapLookup addr <$> get >>= maybeM (throwResumable (UnallocatedAddress addr)) >>= derefCell addr >>= maybeM (throwResumable (UninitializedAddress addr))
|
||||
|
Loading…
Reference in New Issue
Block a user