1
1
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:
Rob Rix 2018-05-31 08:52:42 -04:00
parent ffd1e3e3f8
commit eb40de097e

View File

@ -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))