-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Control flow/Abnormal/Throwing/handle-recursively.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.ControlFlow.Abnormal.Throwing.HandleRecursively where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("handle-recursively",NonStrictFuncon stepHandle_recursively)] -- | -- /handle-recursively/ behaves similarly to /handle-thrown/ , except that -- another copy of the handler attempts to handle any values thrown by the -- handler. Thus, many thrown values may get caught by the same handler. handle_recursively_ fargs = FApp "handle-recursively" (FTuple fargs) stepHandle_recursively fargs = evalRules [rewrite1] [] where rewrite1 = do let env = emptyEnv env <- fsMatch fargs [PMetaVar "E",PMetaVar "H"] env rewriteTermTo (TApp "handle-thrown" (TTuple [TVar "E",TApp "handle-recursively" (TTuple [TVar "H",TVar "H"])])) env