Hostname: page-component-6766d58669-7cz98 Total loading time: 0 Render date: 2026-05-24T14:39:29.864Z Has data issue: false hasContentIssue false

Doo bee doo bee doo

Published online by Cambridge University Press:  31 March 2020

LUKAS CONVENT
Affiliation:
University of Lübeck, Lübeck, Germany, (e-mail: convent@isp.uni-luebeck.de)
SAM LINDLEY
Affiliation:
The University of Edinburgh, EdinburghEH8 9YL, UK and Imperial College London, LondonSW7 2BU, UK, (e-mail: sam.lindley@ed.ac.uk)
CONOR MCBRIDE
Affiliation:
University of Strathclyde, GlasgowG1 1XQ, UK, (e-mail: conor.mcbride@strath.ac.uk)
CRAIG MCLAUGHLIN
Affiliation:
The University of Edinburgh, EdinburghEH8 9YL, UK and University of New South Wales, Kensington, Australia and Data61, CSIRO, Australia, (e-mail: c.mclaughlin@unsw.edu.au)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We explore the design and implementation of Frank, a strict functional programming language with a bidirectional effect type system designed from the ground up around a novel variant of Plotkin and Pretnar’s effect handler abstraction. Effect handlers provide an abstraction for modular effectful programming: a handler acts as an interpreter for a collection of commands whose interfaces are statically tracked by the type system. However, Frank eliminates the need for an additional effect handling construct by generalising the basic mechanism of functional abstraction itself. A function is but the special case of a Frank operator that interprets no commands. Moreover, Frank’s operators can be multihandlers which simultaneously interpret commands from several sources at once, without disturbing the direct style of functional programming with values. Effect typing in Frank employs a novel form of effect polymorphism which avoids mentioning effect variables in source code. This is achieved by propagating an ambient ability inwards, rather than accumulating unions of potential effects outwards. With the ambient ability describing the effects that are available at a certain point in the code, it can become necessary to reconfigure access to the ambient ability. A primary goal is to be able to encapsulate internal effects, eliminating a phenomenon we call effect pollution. Moreover, it is sometimes desirable to rewire the effect flow between effectful library components. We propose adaptors as a means for supporting both effect encapsulation and more general rewiring. Programming with effects and handlers is in its infancy. We contribute an exploration of future possibilities, particularly in combination with other forms of rich type systems.

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 (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s), 2020. Published by Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.