Results 1 - 10
of
26
Putting Type Annotations to Work
, 1996
"... We study an extension of the Hindley-Milner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, user-defined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the po ..."
Abstract
-
Cited by 91 (1 self)
- Add to MetaCart
We study an extension of the Hindley-Milner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, user-defined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the polymorphic lambda calculus can be encoded by a translation between typing derivations. We show that type reconstruction in this system can be reduced to the decidable problem of first-order unification under a mixed prefix.
Type Classes: An Exploration of the Design Space
- In Haskell Workshop
, 1997
"... When type classes were first introduced in Haskell they were regarded as a fairly experimental language feature, and therefore warranted a fairly conservative design. Since that time, practical experience has convinced many programmers of the benefits and convenience of type classes. However, on occ ..."
Abstract
-
Cited by 84 (8 self)
- Add to MetaCart
When type classes were first introduced in Haskell they were regarded as a fairly experimental language feature, and therefore warranted a fairly conservative design. Since that time, practical experience has convinced many programmers of the benefits and convenience of type classes. However, on occasion, these same programmers have discovered examples where seemingly natural applications for type class overloading are prevented by the restrictions imposed by the Haskell design. It is possible to extend the type class mechanism of Haskell in various ways to overcome these limitations, but such proposals must be designed with great care. For example, several different extensions have been implemented in Gofer. Some of these, particularly the support for multi-parameter classes, have proved to be very useful, but interactions between other aspects of the design have resulted in a type system that is both unsound and undecidable. Another illustration is the introduction of constructor cla...
An overview of the Scala programming language
, 2004
"... Scala fuses object-oriented and functional programming in a statically typed programming language. It is aimed at the construction of components and component systems. This paper gives an overview of the Scala language for readers who are familar with programming methods and programming language des ..."
Abstract
-
Cited by 79 (7 self)
- Add to MetaCart
Scala fuses object-oriented and functional programming in a statically typed programming language. It is aimed at the construction of components and component systems. This paper gives an overview of the Scala language for readers who are familar with programming methods and programming language design.
Implicit parameters: dynamic scoping with static types
- In POPL’00
, 2000
"... This paper introduces a language feature, called implicit parameters, that provides dynamically scoped variables within a statically-typed Hindley-Milner framework. Implicit parameters are lexically distinct from regular identifiers, and are bound by a special with construct whose scope is dynamic, ..."
Abstract
-
Cited by 70 (3 self)
- Add to MetaCart
This paper introduces a language feature, called implicit parameters, that provides dynamically scoped variables within a statically-typed Hindley-Milner framework. Implicit parameters are lexically distinct from regular identifiers, and are bound by a special with construct whose scope is dynamic, rather than static as with let. Implicit parameters are treated by the type system as parameters that are not explicitly declared, but are inferred from their use. We present implicit parameters within a small call-by-name X-calculus. We give a type system, a type inference algorithm, and several semantics. We also explore implicit parameters in the wider settings of call-by-need languages with overloading, and call-by-value languages with effects. As a witness to the former, we have implemented implicit parameters as an extension of Haskell within the Hugs interpreter, which we use to present several motivating examples. 1 A Scenario: Pretty Printing You have just finished writing the perfect pretty printer. It takes as input a document to be laid out, and produces a string. pretty:: Dot-> String You have done the hard part-your code is lovely, concise and modular, and your pretty printer produces output that is somehow even prettier than anything you would bother to do by hand. You’re thinking: JFP: Functional Pearl. But, there are just a few fussy details left. For example, you were not focusing on the unimportant details, so you hard-coded the width of the display to be 78 characters. The annoying thing is that the check to see if YOU have exceeded the display width is buried deep within the code.... if i> = 78 then.. permission to make digital or hard copies of all or part ofthis work for PersOXll Or &SSrOOnl USC is granted witllout fee provided that copies are not nn & or distributed for prolit or commercial advantage a$ld that copies bar this notice and the full citation on the first page. ~l‘o cC,py
A theory of overloading
- ACM Transactions on Programming Languages and Systems (TOPLAS
, 2002
"... Abstract We introduce a novel approach for debugging ill-typed programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to f ..."
Abstract
-
Cited by 52 (17 self)
- Add to MetaCart
Abstract We introduce a novel approach for debugging ill-typed programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to find minimal justifications of type errors, and to explain unexpected types that arise. Through an interactive process akin to declarative debugging, a user can track down exactly where a type error occurs. We are able to capture various extensions of the Hindley/Milner system such as type annotations and Haskell-style type class overloading. The approach has been implemented as part of the Chameleon system.
Type Checking Higher-Order Polymorphic Multi-Methods
, 1997
"... We present a new predicative and decidable type system, called ML , suitable for languages that integrate functional programming and parametric polymorphism in the tradition of ML [21, 28], and class-based objectoriented programming and higher-order multi-methods in the tradition of CLOS [12]. Inste ..."
Abstract
-
Cited by 49 (0 self)
- Add to MetaCart
We present a new predicative and decidable type system, called ML , suitable for languages that integrate functional programming and parametric polymorphism in the tradition of ML [21, 28], and class-based objectoriented programming and higher-order multi-methods in the tradition of CLOS [12]. Instead of using extensible records as a foundation for object-oriented extensions of functional languages, we propose to reinterpret ML datatype declarations as abstract and concrete class declarations, and to replace pattern matching on run-time values by dynamic dispatch on run-time types. ML is based on universally quantified polymorphic constrained types. Constraints are conjunctions of inequalities between monotypes built from type constructors organized into extensible and partially ordered classes. We give type checking rules for a small, explicitly typed functional language `a la XML [20] with multi-methods, show that the resulting system has decidable minimal types, and discuss subject ...
Type inference with constrained types
- Fourth International Workshop on Foundations of Object-Oriented Programming (FOOL)
, 1997
"... We present a general framework HM(X) for type systems with constraints. The framework stays in the tradition of the Hindley/Milner type system. Its type system instances are sound under a standard untyped compositional semantics. We can give a generic type inference algorithm for HM(X) so that, unde ..."
Abstract
-
Cited by 42 (5 self)
- Add to MetaCart
We present a general framework HM(X) for type systems with constraints. The framework stays in the tradition of the Hindley/Milner type system. Its type system instances are sound under a standard untyped compositional semantics. We can give a generic type inference algorithm for HM(X) so that, under sufficient conditions on X, type inference will always compute the principal type of a term. We discuss instances of the framework that deal with polymorphic records, equational theories and subtypes.
A General Framework for Hindley/Milner Type Systems with Constraints
, 2000
"... with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the applicat ..."
Abstract
-
Cited by 29 (8 self)
- Add to MetaCart
with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the application in mind. For instance, the Hindley/Milner system can be recovered by instantiating the constraint part to the standard Herbrand constraint system. Type system instances of the general framework are sound if the underlying constraint system is sound. Furthermore, I give a generic type inference algorithm for the general framework, under sucient conditions on the speci c constraint system type inference yields principal types.
The Liberty structural specification language: a high-level modeling language for component reuse
- in 2004 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04
, 2004
"... Rapid exploration of the design space with simulation models is essential for quality hardware systems research and development. Despite striking commonalities across hardware systems, designers routinely fail to achieve high levels of reuse across models constructed in existing general-purpose and ..."
Abstract
-
Cited by 23 (7 self)
- Add to MetaCart
Rapid exploration of the design space with simulation models is essential for quality hardware systems research and development. Despite striking commonalities across hardware systems, designers routinely fail to achieve high levels of reuse across models constructed in existing general-purpose and domain-specific languages. This lack of reuse adversely impacts hardware system design by slowing the rate at which ideas are evaluated. This paper presents an examination of existing languages to reveal their fundamental limitations regarding reuse in hardware modeling. With this understanding, a solution is described in the context of the design and implementation of the Liberty Structural Specification Language (LSS), the input language for a publicly available high-level digital-hardware modeling tool called the Liberty Simulation Environment. LSS is the first language to enable low-overhead reuse by simultaneously supporting static inference based on hardware structure and flexibility via parameterizable structure. Through LSS, this paper also introduces a new type inference algorithm and a new programming language technique, called use-based specialization, which, in a manner analogous to type inference, customizes reusable components by statically inferring structural properties that otherwise would have had to have been specified manually.
Hindley/Milner style type systems in constraint form
, 1999
"... This papers describes Hindley/Milner style type systems in constraint form. Previously, many type descriptions have still been partially represented in the type language. We argue that this can lead to shortcomings in the type and inference system. Examples are given to support this statement. As a ..."
Abstract
-
Cited by 16 (1 self)
- Add to MetaCart
This papers describes Hindley/Milner style type systems in constraint form. Previously, many type descriptions have still been partially represented in the type language. We argue that this can lead to shortcomings in the type and inference system. Examples are given to support this statement. As a solution we present a purely constraint-based formulation of Hindley/Milner style type systems which enjoys much nicer logical properties than previous approaches. More specifically, we present a solution to the open problem of type inference in non-regular theories.

