1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 16:37:50 +03:00

Define a define helper for defining definitions.

This commit is contained in:
Rob Rix 2018-06-18 09:50:04 -04:00
parent d92e64cbec
commit 5e4e586f2d

View File

@ -24,6 +24,20 @@ builtin s def = withCurrentCallStack callStack $ do
bind name' addr
def >>= assign addr
define :: ( HasCallStack
, Member (Allocator address value) effects
, Member (Env address) effects
, Member (Reader ModuleInfo) effects
, Member (Reader Span) effects
)
=> Name
-> Evaluator address value effects value
-> Evaluator address value effects ()
define name def = withCurrentCallStack callStack $ do
addr <- alloc name
bind name addr
def >>= assign addr
lambda :: (AbstractFunction address value effects, Member Fresh effects)
=> (Name -> Evaluator address value effects address)
-> Evaluator address value effects value