1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

lambda assumes no free variables.

This commit is contained in:
Rob Rix 2018-05-28 10:52:29 -04:00
parent 3fcdae3ac8
commit 54988fa3df

View File

@ -45,12 +45,11 @@ builtin b def = withCurrentCallStack callStack $ do
def >>= assign addr
lambda :: (AbstractFunction location value effects, Member Fresh effects)
=> Set Name
-> (Name -> Evaluator location value effects value)
=> (Name -> Evaluator location value effects value)
-> Evaluator location value effects value
lambda fvs body = do
lambda body = do
var <- nameI <$> fresh
closure [var] fvs (body var)
closure [var] lowerBound (body var)
defineBuiltins :: ( AbstractValue location value effects
, HasCallStack
@ -69,7 +68,7 @@ defineBuiltins :: ( AbstractValue location value effects
)
=> Evaluator location value effects ()
defineBuiltins =
builtin Print (lambda lowerBound (\ v -> variable v >>= asString >>= trace . unpack >> unit))
builtin Print (lambda (\ v -> variable v >>= asString >>= trace . unpack >> unit))
-- | Call a 'Builtin' with parameters.