Doo bee doo bee doo
Convent, Lukas and Lindley, Sam and McBride, Conor and McLaughlin, Craig (2020) Doo bee doo bee doo. Journal of Functional Programming, 30. e9. ISSN 0956-7968 (https://doi.org/10.1017/S0956796820000039)
Preview |
Text.
Filename: Convent_etal_JFP_Doo_bee_doo_bee_doo.pdf
Final Published Version License: Download (1MB)| Preview |
Abstract
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.
ORCID iDs
Convent, Lukas, Lindley, Sam, McBride, Conor ORCID: https://orcid.org/0000-0003-1487-0886 and McLaughlin, Craig;-
-
Item type: Article ID code: 73505 Dates: DateEvent31 March 2020Published1 January 2020AcceptedSubjects: Science > Mathematics > Computer software Department: Faculty of Science > Computer and Information Sciences Depositing user: Pure Administrator Date deposited: 06 Aug 2020 15:23 Last modified: 15 Nov 2024 01:13 Related URLs: URI: https://strathprints.strath.ac.uk/id/eprint/73505