Koka: Programming with Row Polymorphic Effect Types.
Daan Leijen
- 05 Jun 2014
- Vol. 153, pp 100-126
TL;DR: This work proposes a programming model where effects are treated in a disciplined way, and where the potential side-effects of a function are apparent in its type signature, and describes a polymorphic type inference system based on Hindley-Milner style inference.
read more
Abstract: We propose a programming model where effects are treated in a disciplined way, and where the potential side-effects of a function are apparent in its type signature. The type and effect of expressions can also be inferred automatically, and we describe a polymorphic type inference system based on Hindley-Milner style inference. A novel feature is that we support polymorphic effects through row-polymorphism using duplicate labels. Moreover, we show that our effects are not just syntactic labels but have a deep semantic connection to the program. For example, if an expression can be typed without an exn effect, then it will never throw an unhandled exception. Similar to Haskell’s runST we show how we can safely encapsulate stateful operations. Through the state effect, we can also safely combine state with letpolymorphism without needing either imperative type variables or a syntactic value restriction. Finally,our system is implemented fully in a new language called Koka and has been used successfully on various small to mediumsized sample programs ranging from a Markdown processor to a tier-splitted chat application.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Koka: Programming with Row Polymorphic Effect Types.
Daan Leijen
- 05 Jun 2014
TL;DR: This work proposes a programming model where effects are treated in a disciplined way, and where the potential side-effects of a function are apparent in its type signature, and describes a polymorphic type inference system based on Hindley-Milner style inference.
Liberating effects with rows and handlers
Daniel Hillerström,Sam Lindley +1 more
- 18 Sep 2016
TL;DR: This paper argues that the abstraction required to implement extensible effects and their handlers is exactly row polymorphism, and presents a core calculus of row-polymorphic effects and handlers based on a variant of A-normal form used in the intermediate representation of Links.
Algebraic Effects for Functional Programming (Type Directed Compilation of Row-typed Algebraic Effects)
Daan Leijen
- 01 Jan 2016
TL;DR: In this article, an end-to-end overview of algebraic effect handlers in the context of a compiled implementation in the Koka language is given, and an effective type inference algorithm based on extensible effect rows using scoped labels, and a direct operational semantics.
Getting to the point: index sets and parallelism-preserving autodiff for pointful array programming
Adam Paszke,Daniel D. Johnson,David Duvenaud,Dimitrios Vytiniotis,Alexey Radul,Matthew J. Johnson,Jonathan Ragan-Kelley,Dougal Maclaurin +7 more
- 18 Aug 2021
TL;DR: The Futhark array programming language as discussed by the authors is a programming language designed to combine the clarity and safety of high-level functional languages with the efficiency and parallelism of low-level numerical languages.
•Posted Content
Do be do be do
TL;DR: The design and implementation of Frank is explored, 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 and an exploration of future possibilities is contributed.
48
References
•Book
The Java Language Specification
James Gosling,Bill Joy,Guy L. Steele +2 more
- 12 Sep 1996
TL;DR: The Java Language Specification, Second Edition is the definitive technical reference for the Java programming language and provides complete, accurate, and detailed coverage of the syntax and semantics of the Java language.
A theory of type polymorphism in programming
TL;DR: This work presents a formal type discipline for polymorphic procedures in the context of a simple programming language, and a compile time type-checking algorithm w which enforces the discipline.
2.6K
Principal type-schemes for functional programs
Luis Damas,Robin Milner +1 more
- 25 Jan 1982
TL;DR: Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage.
A Syntactic Approach to Type Soundness
TL;DR: A new approach to proving type soundness for Hindley/Milner-style polymorphic type systems by an adaptation of subject reduction theorems from combinatory logic to programming languages and the use of rewriting techniques for the specification of the language semantics is presented.
1.2K
The type and effect discipline
Jean-Pierre Talpin,Pierre Jouvelot +1 more
- 22 Jun 1992
TL;DR: The type and effect discipline, a framework for reconstructing the principal type and the minimal effect of expressions in implicitly typed polymorphic functional languages that support imperative constructs, is introduced and outperforms other polymorphic type systems.
253
Related Papers (5)
Gordon Plotkin,Matija Pretnar +1 more
Gordon Plotkin,John Power +1 more
[...]
Ohad Kammar,Sam Lindley,Nicolas Oury +2 more
- 25 Sep 2013
Daniel Hillerström,Sam Lindley +1 more
- 18 Sep 2016