1
1
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:
Rob Rix 2018-07-12 09:17:42 -04:00
parent 38b48a8a0c
commit 635de237a2
2 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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)