1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Define lambda using Lambda.

This commit is contained in:
Rob Rix 2018-07-31 11:48:07 -04:00
parent d472ead088
commit 1e89a8423a
2 changed files with 4 additions and 7 deletions

View File

@ -63,16 +63,13 @@ defineNamespace name scope = define name $ do
namespace name Nothing binds
lambda :: ( HasCallStack
, Member Fresh effects
, Member (Function address value) effects
, Lambda address value effects fn
, Member (Reader ModuleInfo) effects
, Member (Reader Span) effects
)
=> (Name -> Evaluator address value effects address)
=> fn
-> Evaluator address value effects value
lambda body = withCurrentCallStack callStack $ do
var <- gensym
function [var] lowerBound (body var)
lambda body = withCurrentCallStack callStack (lambda' [] body)
lambda2 :: ( HasCallStack
, Member Fresh effects

View File

@ -169,7 +169,7 @@ instance HasPrelude 'Ruby where
define (name "puts") builtInPrint
defineClass (name "Object") [] $ do
define (name "inspect") (lambda (const (box (string "<object>"))))
define (name "inspect") (lambda (box (string "<object>")))
instance HasPrelude 'TypeScript where
definePrelude _ =