1
1
mirror of https://github.com/github/semantic.git synced 2025-01-01 19:55:34 +03:00

implement Lower for EvalContext

This commit is contained in:
Charlie Somerville 2018-07-24 15:22:58 +10:00
parent ec163d5910
commit 2fbbd239e3

View File

@ -58,6 +58,9 @@ newtype Environment address = Environment { unEnvironment :: NonEmpty (Bindings
data EvalContext address = EvalContext { ctxSelf :: Maybe address, ctxEnvironment :: Environment address }
deriving (Eq, Ord, Show)
instance Lower (EvalContext address) where
lowerBound = EvalContext Nothing lowerBound
-- | Make and enter a new empty scope in the given environment.
push :: Environment address -> Environment address
push (Environment (a :| as)) = Environment (mempty :| a : as)