mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Move builtInPrint to Control.Abstract.Primitive.
This commit is contained in:
parent
38b48a8a0c
commit
635de237a2
@ -75,3 +75,17 @@ defineBuiltins :: ( AbstractValue address value effects
|
||||
=> Evaluator address value effects ()
|
||||
defineBuiltins =
|
||||
define "__semantic_print" (lambda (\ v -> variable v >>= deref >>= asString >>= trace . unpack >> box unit))
|
||||
|
||||
builtInPrint :: ( AbstractIntro value
|
||||
, AbstractFunction address value effects
|
||||
, Member (Allocator address value) effects
|
||||
, Member (Env address) effects
|
||||
, Member Fresh effects
|
||||
, Member (Resumable (EnvironmentError address)) effects
|
||||
)
|
||||
=> Name
|
||||
-> Evaluator address value effects address
|
||||
builtInPrint v = do
|
||||
print <- variable "__semantic_print" >>= deref
|
||||
void $ call print [variable v]
|
||||
box unit
|
||||
|
@ -148,20 +148,6 @@ instance HasPrelude 'Haskell
|
||||
instance HasPrelude 'Java
|
||||
instance HasPrelude 'PHP
|
||||
|
||||
builtInPrint :: ( AbstractIntro value
|
||||
, AbstractFunction address value effects
|
||||
, Member (Allocator address value) effects
|
||||
, Member (Env address) effects
|
||||
, Member Fresh effects
|
||||
, Member (Resumable (EnvironmentError address)) effects
|
||||
)
|
||||
=> Name
|
||||
-> Evaluator address value effects address
|
||||
builtInPrint v = do
|
||||
print <- variable "__semantic_print" >>= deref
|
||||
void $ call print [variable v]
|
||||
box unit
|
||||
|
||||
instance HasPrelude 'Python where
|
||||
definePrelude _ =
|
||||
define "print" (lambda builtInPrint)
|
||||
|
Loading…
Reference in New Issue
Block a user