A framework for higher-order effects & handlers.
Saved in:
| Title: | A framework for higher-order effects & handlers. |
|---|---|
| Authors: | van den Berg, Birthe1 (AUTHOR), Schrijvers, Tom1 (AUTHOR) tom.schrijvers@kuleuven.be |
| Source: | Science of Computer Programming. May2024, Vol. 234, pN.PAG-N.PAG. 1p. |
| Subjects: | Authorship in literature, Syntax (Grammar), Semantics |
| Abstract: | Algebraic effects & handlers are a modular approach for modeling side-effects in functional programming. Their syntax is defined in terms of a signature of effectful operations, encoded as a functor, that are plugged into the free monad; their denotational semantics is defined by fold-style handlers that only interpret their part of the syntax and forward the rest. However, not all effects are algebraic: some need to access an internal computation. For example, scoped effects distinguish between a computation in scope and out of scope; parallel effects parallelize over a computation, latent effects defer a computation. Separate definitions have been proposed for these higher-order effects and their corresponding handlers, often leading to expedient and complex monad definitions. In this work we propose a generic framework for higher-order effects, generalizing algebraic effects & handlers: a generic free monad with higher-order effect signatures and a corresponding interpreter. Specializing this higher-order syntax leads to various definitions of previously defined (scoped, parallel, latent) and novel (writer, bracketing) effects. Furthermore, we formally show our framework theoretically correct, also putting different effect instances on formal footing; a significant contribution for parallel, latent, writer and bracketing effects. • A generic monad and recursion scheme with higher-order effect signatures. • A modeling of different classes of effects, both from the literature and novel. • Practical programming examples. • A categorical model based on a free-forgetful adjunction proves our monad is free. [ABSTRACT FROM AUTHOR] |
| Copyright of Science of Computer Programming is the property of Elsevier B.V. and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.) | |
| Database: | Engineering Source |
| FullText | Text: Availability: 0 |
|---|---|
| Header | DbId: egs DbLabel: Engineering Source An: 175833888 AccessLevel: 6 PubType: Academic Journal PubTypeId: academicJournal PreciseRelevancyScore: 0 |
| IllustrationInfo | |
| Items | – Name: Title Label: Title Group: Ti Data: A framework for higher-order effects & handlers. – Name: Author Label: Authors Group: Au Data: <searchLink fieldCode="AR" term="%22van+den+Berg%2C+Birthe%22">van den Berg, Birthe</searchLink><relatesTo>1</relatesTo> (AUTHOR)<br /><searchLink fieldCode="AR" term="%22Schrijvers%2C+Tom%22">Schrijvers, Tom</searchLink><relatesTo>1</relatesTo> (AUTHOR)<i> tom.schrijvers@kuleuven.be</i> – Name: TitleSource Label: Source Group: Src Data: <searchLink fieldCode="JN" term="%22Science+of+Computer+Programming%22">Science of Computer Programming</searchLink>. May2024, Vol. 234, pN.PAG-N.PAG. 1p. – Name: Subject Label: Subjects Group: Su Data: <searchLink fieldCode="DE" term="%22Authorship+in+literature%22">Authorship in literature</searchLink><br /><searchLink fieldCode="DE" term="%22Syntax+%28Grammar%29%22">Syntax (Grammar)</searchLink><br /><searchLink fieldCode="DE" term="%22Semantics%22">Semantics</searchLink> – Name: Abstract Label: Abstract Group: Ab Data: Algebraic effects & handlers are a modular approach for modeling side-effects in functional programming. Their syntax is defined in terms of a signature of effectful operations, encoded as a functor, that are plugged into the free monad; their denotational semantics is defined by fold-style handlers that only interpret their part of the syntax and forward the rest. However, not all effects are algebraic: some need to access an internal computation. For example, scoped effects distinguish between a computation in scope and out of scope; parallel effects parallelize over a computation, latent effects defer a computation. Separate definitions have been proposed for these higher-order effects and their corresponding handlers, often leading to expedient and complex monad definitions. In this work we propose a generic framework for higher-order effects, generalizing algebraic effects & handlers: a generic free monad with higher-order effect signatures and a corresponding interpreter. Specializing this higher-order syntax leads to various definitions of previously defined (scoped, parallel, latent) and novel (writer, bracketing) effects. Furthermore, we formally show our framework theoretically correct, also putting different effect instances on formal footing; a significant contribution for parallel, latent, writer and bracketing effects. • A generic monad and recursion scheme with higher-order effect signatures. • A modeling of different classes of effects, both from the literature and novel. • Practical programming examples. • A categorical model based on a free-forgetful adjunction proves our monad is free. [ABSTRACT FROM AUTHOR] – Name: AbstractSuppliedCopyright Label: Group: Ab Data: <i>Copyright of Science of Computer Programming is the property of Elsevier B.V. and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract.</i> (Copyright applies to all Abstracts.) |
| PLink | https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=egs&AN=175833888 |
| RecordInfo | BibRecord: BibEntity: Identifiers: – Type: doi Value: 10.1016/j.scico.2024.103086 Languages: – Code: eng Text: English PhysicalDescription: Pagination: PageCount: 1 StartPage: N.PAG Subjects: – SubjectFull: Authorship in literature Type: general – SubjectFull: Syntax (Grammar) Type: general – SubjectFull: Semantics Type: general Titles: – TitleFull: A framework for higher-order effects & handlers. Type: main BibRelationships: HasContributorRelationships: – PersonEntity: Name: NameFull: van den Berg, Birthe – PersonEntity: Name: NameFull: Schrijvers, Tom IsPartOfRelationships: – BibEntity: Dates: – D: 01 M: 05 Text: May2024 Type: published Y: 2024 Identifiers: – Type: issn-print Value: 01676423 Numbering: – Type: volume Value: 234 Titles: – TitleFull: Science of Computer Programming Type: main |
| ResultId | 1 |