Handlers in Action

被引:0
|
作者
Kammar, Ohad [1 ]
Lindley, Sam [2 ]
Oury, Nicolas
机构
[1] Univ Cambridge, Cambridge CB2 1TN, England
[2] Univ Strathclyde, Glasgow G1 1XQ, Lanark, Scotland
基金
英国工程与自然科学研究理事会;
关键词
algebraic effects; effect handlers; effect typing; monads; continuations; Haskell; modularity;
D O I
10.1145/2544174.2500590
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Plotkin and Pretnar's handlers for algebraic effects occupy a sweet spot in the design space of abstractions for effectful computation. By separating effect signatures from their implementation, algebraic effects provide a high degree of modularity, allowing programmers to express effectful programs independently of the concrete interpretation of their effects. A handler is an interpretation of the effects of an algebraic computation. The handler abstraction adapts well to multiple settings: pure or impure, strict or lazy, static types or dynamic types. This is a position paper whose main aim is to popularise the handler abstraction. We give a gentle introduction to its use, a collection of illustrative examples, and a straightforward operational semantics. We describe our Haskell implementation of handlers in detail, outline the ideas behind our OCaml, SML, and Racket implementations, and present experimental results comparing handlers with existing code.
引用
收藏
页码:145 / 158
页数:14
相关论文
共 50 条
  • [1] The 'Abalone Handlers'
    Allen, F
    TLS-THE TIMES LITERARY SUPPLEMENT, 2004, (5308): : 4 - 4
  • [2] 'Snake Handlers'
    Donnelly, P
    PLOUGHSHARES, 2002, 28 (04) : 64 - 65
  • [3] SNAKE HANDLERS
    ALTHER, L
    NEW SOCIETY, 1975, 34 (687): : 532 - 535
  • [4] 'SNAKE HANDLERS'
    WILLIAMS, P
    MUNDUS ARTIUM, 1976, 9 (01): : 90 - 90
  • [5] The 'abalone handlers'
    Allen, F
    TLS-THE TIMES LITERARY SUPPLEMENT, 2005, (5307-8): : 4 - 4
  • [6] Animal handlers - Preface
    Langley, RL
    OCCUPATIONAL MEDICINE-STATE OF THE ART REVIEWS, 1999, 14 (02): : XIII - XIV
  • [7] PIG HANDLERS ITCH
    CHAKRABARTI, A
    INTERNATIONAL JOURNAL OF DERMATOLOGY, 1990, 29 (03) : 205 - 206
  • [8] IMPROVING OVERLAY HANDLERS
    HANSCHE, B
    SOFTWARE-PRACTICE & EXPERIENCE, 1983, 13 (06): : 545 - 548
  • [9] Effect Handlers, Evidently
    Xie, Ningning
    Brachthaeuser, Jonathan Immanuel
    Hillerstroem, Daniel
    Schuster, Philipp
    Leijen, Daan
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (ICFP):
  • [10] Handlers of Algebraic Effects
    Plotkin, Gordon
    Pretnar, Matija
    PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2009, 5502 : 80 - 94