Signature restriction for polymorphic algebraic effects
Furkejuvvon:
| Publikašuvnnas: | Journal of Functional Programming vol. 34 (May 2024) |
|---|---|
| Váldodahkki: | |
| Eará dahkkit: | , |
| Almmustuhtton: |
Cambridge University Press
|
| Fáttát: | |
| Liŋkkat: | Citation/Abstract Full Text - PDF |
| Fáddágilkorat: |
Eai fáddágilkorat, Lasit vuosttaš fáddágilkora!
|
| Abstrákta: | 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. |
|---|---|
| ISSN: | 0956-7968 1469-7653 |
| DOI: | 10.1017/S0956796824000054 |
| Gáldu: | Advanced Technologies & Aerospace Database |