Hostname: page-component-77c78cf97d-bzm8f Total loading time: 0 Render date: 2026-04-24T18:07:41.730Z Has data issue: false hasContentIssue false

Signature restriction for polymorphic algebraic effects

Part of: ICFP20/21

Published online by Cambridge University Press:  27 May 2024

TARO SEKIYAMA
Affiliation:
National Institute of Informatics & SOKENDAI, Tokyo, Japan (e-mail: tsekiyama@acm.org)
TAKESHI TSUKADA
Affiliation:
Chiba University, Chiba, Japan (e-mail: tsukada@math.s.chiba-u.ac.jp)
ATSUSHI IGARASHI
Affiliation:
Graduate School of Informatics, Kyoto University, Kyoto, Japan (e-mail: igarashi@kuis.kyoto-u.ac.jp)
Rights & Permissions [Opens in a new window]

Abstract

The naive combination of polymorphic effects and polymorphic type assignment has been well known to break type safety. In the literature, there are two kinds of approaches to this problem: one is to restrict how effects are triggered and the other is to restrict how they are implemented. This work explores a new approach to ensuring the safety of the use of polymorphic effects in polymorphic type assignment. A novelty of our work is to restrict effect interfaces. To formalize our idea, we employ algebraic effects and handlers, where an effect interface is given by a set of operations coupled with type signatures. We propose signature restriction, a new notion to restrict the type signatures of operations and show that signature restriction ensures type safety of a language equipped with polymorphic effects and unrestricted polymorphic type assignment. We also develop a type-and-effect system to enable the use of both of the operations that satisfy and those that do not satisfy the signature restriction in a single program.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2024. Published by Cambridge University Press
Figure 0

Fig 1. Syntax of $\lambda_{\text{eff}}$.

Figure 1

Fig 2. Semantics of $\lambda_{\text{eff}}$.

Figure 2

Fig 3. The type language.

Figure 3

Fig 4. Polymorphic type system for $\lambda_{\text{eff}}$.

Figure 4

Fig 5. The extended part of the syntax and semantics.

Figure 5

Fig 6. The extended part of the type system.

Figure 6

Fig 7. The effect system (excerpt).

Figure 7

Table 1. Features of type systems for polymorphic algebraic effects

Supplementary material: File

Sekiyama et al. supplementary material

Sekiyama et al. supplementary material

Download Sekiyama et al. supplementary material(File)
File 401.8 KB
Submit a response

Discussions

No Discussions have been published for this article.