mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Define a define helper for defining definitions.
This commit is contained in:
parent
d92e64cbec
commit
5e4e586f2d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user