1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00

throw FreeVariableError rather than failing in identifier eval

This commit is contained in:
Charlie Somerville 2018-03-28 11:24:58 +11:00
parent b1a195f7e7
commit d5baf53ebd

View File

@ -106,7 +106,7 @@ instance Ord1 Identifier where liftCompare = genericLiftCompare
instance Show1 Identifier where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Identifier where
eval (Identifier name) = lookupWith deref name >>= maybe (fail ("free variable: " <> show (friendlyName name))) pure
eval (Identifier name) = lookupWith deref name >>= maybe (throwException $ FreeVariableError name) pure
instance FreeVariables1 Identifier where
liftFreeVariables _ (Identifier x) = pure x