We provide an effect system CatEff based on a category-graded extension of algebraic theories that correspond to category-graded monads. CatEff has category-graded operations and handlers. Effects in CatEff are graded by morphisms of the grading category. Grading morphisms represent fine structures of effects such as dependencies or sorts of states. Handlers in CatEff are regarded as an implementation of category-graded effects. We define the notion of category-graded algebraic theory to give semantics of CatEff and prove soundness and adequacy. We also give an example using category-graded effects to express protocols for sending receiving typed data.
翻译:我们提供一种效果系统CatEff, 其依据是按类别分类的代数理论的扩展,与按类别分类的月经相对应。 CatEff 拥有按类别分类的操作和处理器。 CatEff 的效应按等级类别的形态分级。 CatEff 的分级法代表了各种效果的精细结构,例如依赖性或种类的状态。 CatEff 中的处理器被视为是按类别分类的效应的一种实施。 我们定义了按类别分类的代数理论的概念,以提供CatEff的语义并证明其健全性和充分性。 我们还举了一个例子,使用按类别分类的效应来表达发送类型数据的规程。