1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

merge fallout

This commit is contained in:
Patrick Thomson 2018-07-13 11:21:54 -04:00
parent ae550c59c8
commit 25cc331789
4 changed files with 7 additions and 10 deletions

View File

@ -69,7 +69,6 @@ data Env address m return where
GetEnv :: Env address m (Environment address)
PutEnv :: Environment address -> Env address m ()
Export :: Name -> Name -> Maybe address -> Env address m ()
PutEnv :: Environment address -> Env address m ()
instance Effect (Env address) where
handleState c dist (Request (Lookup name) k) = Request (Lookup name) (dist . (<$ c) . k)
@ -79,7 +78,6 @@ instance Effect (Env address) where
handleState c dist (Request GetEnv k) = Request GetEnv (dist . (<$ c) . k)
handleState c dist (Request (PutEnv e) k) = Request (PutEnv e) (dist . (<$ c) . k)
handleState c dist (Request (Export name alias addr) k) = Request (Export name alias addr) (dist . (<$ c) . k)
handleState c dist (Request (PutEnv e) k) = Request (PutEnv e) (dist . (<$ c) . k)
runEnv :: Effects effects
=> Environment address

View File

@ -52,7 +52,6 @@ class (Show1 constr, Foldable constr) => Evaluatable constr where
, Member (Env address) effects
, Member (Exc (LoopControl address)) effects
, Member (Exc (Return address)) effects
, Member Fresh effects
, Member (Modules address) effects
, Member (Reader ModuleInfo) effects
, Member (Reader PackageInfo) effects
@ -155,24 +154,24 @@ instance HasPrelude 'PHP
instance HasPrelude 'Python where
definePrelude _ =
define "print" builtInPrint
define (name "print") builtInPrint
instance HasPrelude 'Ruby where
definePrelude _ = do
define "puts" builtInPrint
define (name "puts") builtInPrint
defineClass (name "Object") [] $ do
define (name "inspect") (lambda (const (box (string "<object>"))))
instance HasPrelude 'TypeScript where
definePrelude _ =
defineNamespace "console" $ do
define "log" builtInPrint
defineNamespace (name "console") $ do
define (name "log") builtInPrint
instance HasPrelude 'JavaScript where
definePrelude _ = do
defineNamespace "console" $ do
define "log" builtInPrint
defineNamespace (name "console") $ do
define (name "log") builtInPrint
-- Postludes

View File

@ -48,7 +48,6 @@ instance ( Member (Allocator address Abstract) effects
instance ( Member (Allocator address Abstract) effects
, Member (Env address) effects
, Member (Exc (Return address)) effects
, Member Fresh effects
, Member NonDet effects
, Member Fresh effects
)

View File

@ -72,6 +72,7 @@ runCallGraph :: ( HasField ann Span
, Evaluatable (Base term)
, FreeVariables term
, HasPrelude lang
, HasPostlude lang
, Member Trace effs
, Recursive term
, Effects effs