-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Control flow/Abnormal/Continuations/plug.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.ControlFlow.Abnormal.Continuations.Plug where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("plug",PartiallyStrictFuncon [NonStrict,Strict] stepPlug)] -- | -- /plug(E,V)/ plugs the value /V/ into a /hole/ that occurs as a subterm -- within the computation /E/ , provided the /hole/ is in an evaluable position. plug_ fargs = FApp "plug" (FTuple fargs) stepPlug fargs@[arg1,arg2] = evalRules [] [step1] where step1 = do let env = emptyEnv env <- lifted_fsMatch fargs [PMetaVar "E",PAnnotated (PMetaVar "V") (TName "values")] env env <- withExactInputTerms "resume-signal" [TVar "V"] env (premise (TVar "E") (PMetaVar "E'") env) stepTermTo (TVar "E'") env stepPlug fargs = sortErr (FApp "plug" (FTuple fargs)) "invalid number of arguments"