Results 1 -
4 of
4
Strongly typed heterogeneous collections
- In Haskell ’04: Proceedings of the ACM SIGPLAN workshop on Haskell
, 2004
"... A heterogeneous collection is a datatype that is capable of storing data of different types, while providing operations for look-up, update, iteration, and others. There are various kinds of heterogeneous collections, differing in representation, invariants, and access operations. We describe HLIST ..."
Abstract
-
Cited by 41 (8 self)
- Add to MetaCart
A heterogeneous collection is a datatype that is capable of storing data of different types, while providing operations for look-up, update, iteration, and others. There are various kinds of heterogeneous collections, differing in representation, invariants, and access operations. We describe HLIST — a Haskell library for strongly typed heterogeneous collections including extensible records. We illustrate HLIST’s benefits in the context of type-safe database access in Haskell. The HLIST library relies on common extensions of Haskell 98. Our exploration raises interesting issues regarding Haskell’s type system, in particular, avoidance of overlapping instances, and reification of type equality and type unification.
Functional logic overloading
, 2002
"... Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on ..."
Abstract
-
Cited by 15 (1 self)
- Add to MetaCart
Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on the evaluation of functional logic programs. Functional logic programming provides a solid theoretical foundation for type functions and, at the same time, allows for programmable overloading resolution strategies by choosing different evaluation strategies for functional logic programs. Type inference with type functions is an instance of type inference with constrained types, where the underlying constraint system is defined by a functional logic program. We have designed a variant of Haskell which supports our approach to overloading, and implemented a prototype frontend for the language.
A Functional Notation for Functional Dependencies
, 2001
"... Functional dependencies help resolve many of the ambiguities that result from the use of multi-parameter type classes. They effectively enable writing programs at the type-level which significantly enhances the expressive power of Haskell's type system. Among the applications of this technique are t ..."
Abstract
-
Cited by 13 (3 self)
- Add to MetaCart
Functional dependencies help resolve many of the ambiguities that result from the use of multi-parameter type classes. They effectively enable writing programs at the type-level which significantly enhances the expressive power of Haskell's type system. Among the applications of this technique are the emulation of dependent types, and precise typechecking for XML and HTML combinator libraries. Unfortunately, the notation presently used for functional dependencies implies that the type-level programs are logic programs, but many of its applications are conceptually functional programs. We propose an alternative notation for functional dependencies which adds a functional-programming notation to Haskell's type classes and makes applications of functional dependencies significantly more readable. We apply the new notation to our examples and study the problems arising due to Haskell's open world assumption and overlapping instances.
Abstract A POPL Pearl Submission Clowns to the Left of me, Jokers to the Right
"... This paper, submitted as a ‘pearl’, introduces a small but useful generalisation to the ‘derivative ’ operation on datatypes underlying Huet’s notion of ‘zipper ’ (Huet 1997; McBride 2001; Abbott et al. 2005b), giving a concrete representation to one-hole contexts in data which is in mid-transformat ..."
Abstract
- Add to MetaCart
This paper, submitted as a ‘pearl’, introduces a small but useful generalisation to the ‘derivative ’ operation on datatypes underlying Huet’s notion of ‘zipper ’ (Huet 1997; McBride 2001; Abbott et al. 2005b), giving a concrete representation to one-hole contexts in data which is in mid-transformation. This operator, ‘dissection’, turns a container-like functor into a bifunctor representing a onehole context in which elements to the left of the hole are distinguished in type from elements to its right. I present dissection for polynomial functors, although it is certainly more general, preferring to concentrate here on its diverse applications. For a start, map-like operations over the functor and fold-like operations over the recursive data structure it induces can be expressed by tail recursion alone. Moreover, the derivative is readily recovered from the dissection, along with Huet’s navigation operations. A further special case of dissection, ‘division’, captures the notion of leftmost hole, canonically distinguishing values with no elements from those with at least one. By way of a more practical example, division and dissection are exploited to give a relatively efficient generic algorithm for abstracting all occurrences of one term from another in a first-order syntax. The source code for the paper is available online 1 and compiles with recent extensions to the Glasgow Haskell Compiler. 1.

