mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
Merge pull request #1683 from github/evaluate-let
Evaluate let-clauses.
This commit is contained in:
commit
ae52cca50a
@ -77,8 +77,11 @@ instance Eq1 Let where liftEq = genericLiftEq
|
|||||||
instance Ord1 Let where liftCompare = genericLiftCompare
|
instance Ord1 Let where liftCompare = genericLiftCompare
|
||||||
instance Show1 Let where liftShowsPrec = genericLiftShowsPrec
|
instance Show1 Let where liftShowsPrec = genericLiftShowsPrec
|
||||||
|
|
||||||
-- TODO: Implement Eval instance for Let
|
instance Evaluatable Let where
|
||||||
instance Evaluatable Let
|
eval Let{..} = do
|
||||||
|
addr <- snd <$> letrec name (subtermValue letValue)
|
||||||
|
localEnv (Env.insert name addr) (subtermValue letBody)
|
||||||
|
where name = freeVariable (subterm letVariable)
|
||||||
|
|
||||||
|
|
||||||
-- Assignment
|
-- Assignment
|
||||||
|
Loading…
Reference in New Issue
Block a user