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:
parent
d472ead088
commit
1e89a8423a
@ -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
|
||||
|
@ -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 _ =
|
||||
|
Loading…
Reference in New Issue
Block a user