1
1
mirror of https://github.com/github/semantic.git synced 2024-12-11 08:45:48 +03:00

Use maybeM to evaluate identifiers.

This commit is contained in:
Rob Rix 2018-03-30 18:41:49 -04:00
parent 0355d81065
commit fe3b9730c4

View File

@ -106,7 +106,7 @@ instance Ord1 Identifier where liftCompare = genericLiftCompare
instance Show1 Identifier where liftShowsPrec = genericLiftShowsPrec instance Show1 Identifier where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Identifier where instance Evaluatable Identifier where
eval (Identifier name) = lookupWith deref name >>= maybe (throwException $ FreeVariableError name) pure eval (Identifier name) = lookupWith deref name >>= maybeM (throwException (FreeVariableError name))
instance FreeVariables1 Identifier where instance FreeVariables1 Identifier where
liftFreeVariables _ (Identifier x) = pure x liftFreeVariables _ (Identifier x) = pure x