1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00

📝 variable.

This commit is contained in:
Rob Rix 2018-03-30 18:46:48 -04:00
parent 92011e8ef2
commit f3b3191969

View File

@ -66,6 +66,7 @@ data EvalError value resume where
-- Indicates we weren't able to dereference a name from the evaluated environment.
FreeVariableError :: Name -> EvalError value value
-- | Look up and dereference the given 'Name', throwing an exception for free variables.
variable :: MonadEvaluatable location term value m => Name -> m value
variable name = lookupWith deref name >>= maybeM (throwException (FreeVariableError name))