1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Generalize resumingValueError over the Effectful context.

This commit is contained in:
Rob Rix 2018-07-17 16:08:41 -04:00
parent 0d352ed121
commit f1d6080fdb

View File

@ -233,7 +233,7 @@ resumingAddressError = runAddressErrorWith $ \ err -> trace ("AddressError: " <>
Unallocated _ -> pure lowerBound
Uninitialized _ -> pure hole
resumingValueError :: (Member Trace effects, Show address, Effects effects) => Evaluator address (Value address body) (Resumable (ValueError address body) ': effects) a -> Evaluator address (Value address body) effects a
resumingValueError :: (Applicative (m address (Value address body) effects), Effectful (m address (Value address body)), Effects effects, Member Trace effects, Show address) => m address (Value address body) (Resumable (ValueError address body) ': effects) a -> m address (Value address body) effects a
resumingValueError = runValueErrorWith (\ err -> trace ("ValueError: " <> prettyShow err) *> case err of
CallError val -> pure val
StringError val -> pure (pack (prettyShow val))