scholarly journals No value restriction is needed for algebraic effects and handlers

Author(s):  
OHAD KAMMAR ◽  
MATIJA PRETNAR

AbstractWe present a straightforward, sound, Hindley–Milner polymorphic type system for algebraic effects and handlers in a call-by-value calculus, which, to our surprise, allows type variable generalisation of arbitrary computations, and not just values. We first recall that the soundness of unrestricted call-by-value Hindley–Milner polymorphism is known to fail in the presence of computational effects such as reference cells and continuations, and that many programming examples can be recast to use effect handlers instead of these effects. After presenting the calculus and its soundness proof, formalised in Twelf, we analyse the expressive power of effect handlers with respect to state effects. We conjecture handlers alone cannot express reference cells, but show they can simulate dynamically scoped state, establishing that dynamic binding also does not need a value restriction.

2000 ◽  
Vol 11 (01) ◽  
pp. 65-87
Author(s):  
MASATOMO HASHIMOTO

This paper develops an ML-style programming language with first-class contexts i.e. expressions with holes. The crucial operation for contexts is hole-filling. Filling a hole with an expression has the effect of dynamic binding or macro expansion which provides the advanced feature of manipulating open program fragments. Such mechanisms are useful in many systems including distributed/mobile programming and program modules. If we can treat a context as a first-class citizen in a programming language, then we can manipulate open program fragments in a flexible and seamless manner. A possibility of such a programming language was shown by the theory of simply typed context calculus developed by Hashimoto and Ohori. This paper extends the simply typed system of the context calculus to an ML-style polymorphic type system, and gives an operational semantics and a sound and complete type inference algorithm.


2008 ◽  
Vol 18 (3) ◽  
pp. 285-331 ◽  
Author(s):  
CHIERI SAITO ◽  
ATSUSHI IGARASHI ◽  
MIRKO VIROLI

AbstractFamily polymorphism has been proposed for object-oriented languages as a solution to supporting reusable yet type-safe mutually recursive classes. A key idea of family polymorphism is the notion of families, which are used to group mutually recursive classes. In the original proposal, due to the design decision that families are represented by objects, dependent types had to be introduced, resulting in a rather complex type system. In this article, we propose a simpler solution oflightweightfamily polymorphism, based on the idea that families are represented by classes rather than by objects. This change makes the type system significantly simpler without losing much expressive power of the language. Moreover, “family-polymorphic” methods now take a form of parametric methods; thus, it is easy to apply method type argument inference as in Java 5.0. To rigorously show that our approach is safe, we formalize the set of language features on top of Featherweight Java and prove that the type system is sound. An algorithm for type inference for family-polymorphic method invocations is also formalized and proved to be correct. Finally, a formal translation by erasure to Featherweight Java is presented; it is proved to preserve typing and execution results, showing that our new language features can be implemented in Java by simply extending the compiler.


1996 ◽  
Vol 6 (1) ◽  
pp. 111-141 ◽  
Author(s):  
John Greiner

AbstractThe weak polymorphic type system of Standard ML of New Jersey (SML/NJ) (MacQueen, 1992) has only been presented as part of the implementation of the SML/NJ compiler, not as a formal type system. As a result, it is not well understood. And while numerous versions of the implementation have been shown unsound, the concept has not been proved sound or unsound. We present an explanation of weak polymorphism and show that a formalization of this is sound. We also relate this to the SML/NJ implementation of weak polymorphism through a series of type systems that incorporate elements of the SML/NJ type inference algorithm.


2006 ◽  
Vol 16 (6) ◽  
pp. 793-811 ◽  
Author(s):  
ALEX POTANIN ◽  
JAMES NOBLE ◽  
DAVE CLARKE ◽  
ROBERT BIDDLE

Existing approaches to object encapsulation either rely on ad hoc syntactic restrictions or require the use of specialised type systems. Syntactic restrictions are difficult to scale and to prove correct, while specialised type systems require extensive changes to programming languages. We demonstrate that confinement can be enforced cheaply in Featherweight Generic Java, with no essential change to the underlying language or type system. This result demonstrates that polymorphic type parameters can simultaneously act as ownership parameters and should facilitate the adoption of confinement and ownership type systems in general-purpose programming languages.


1998 ◽  
Vol 8 (6) ◽  
pp. 573-619 ◽  
Author(s):  
C. B. JAY ◽  
G. BELLÈ ◽  
E. MOGGI

We present an extension of the Hindley–Milner type system that supports a generous class of type constructors called functors, and provide a parametrically polymorphic algorithm for their mapping, i.e. for applying a function to each datum appearing in a value of constructed type. The algorithm comes from shape theory, which provides a uniform method for locating data within a shape. The resulting system is Church–Rosser and strongly normalizing, and supports type inference. Several different semantics are possible, which affects the choice of constants in the language, and are used to illustrate the relationship to polytypic programming.


1972 ◽  
Vol 1 (3) ◽  
Author(s):  
Eckard König

AbstractThe discussion between HABERMAS and ALBERT concerning the problem of ‘Wertfreiheit’ has not yet been finally solved. For this reason it would seem desirable to clarify both positions. In the course of such an explanation, it becomes apparent that the reason for the lack of results between HABERMAS and ALBERT lies in the fact that both authors are talking at cross-purposes. Whereas ALBERT tries to prove that social sciences can be purely empirical and value-free (i.e. containing no value-judgements), HABERMAS is concerned basically not with the question of value-judgements but with that of the value-basis (Wertbasis). On the whole ALBERT assumes that the norms of modern sciences are meaningful and sensible; HABERMAS questions their foundations. His thesis on the ‘technical interest’ (technisches Interesse) does not therefore refer as ALBERT seems to believe to the question of the applicability of empirical sciences but represents an attempt to offer a foundation for these sciences. Admittedly he is only able to make his criticism by presupposing an interest in ‘herrschaftsfreie Kommunikation’ for the explanation of which HABERMAS has suggested several possibilities without as yet having achieved more than initial steps.


Sign in / Sign up

Export Citation Format

Share Document