Extensible records with scoped labels. (draft) [bib, pdf]
Daan Leijen. The 2005 Symposium on Trends in Functional Programming (TFP'05), Tallin, Estonia, September 2005.

Records provide a safe and flexible way to construct data structures. We describe a natural approach to typing polymorphic and extensible records that is simple, easy to use in practice, and straightforward to implement. A novel aspect of this work is that records can contain duplicate labels, effectively introducing a form of scoping over the labels. Furthermore, it is a fully orthogonal extension to existing type systems and programming languages. In particular, we show how it can be used conveniently with standard Hindley-Milner, qualified types, and ML-F. The records are implemented in the experimental Morrow interpreter. There is separate technical report that gives the constructive proofs of soundness and completeness.

Qualified types for MLF. [bib, pdf]
Daan Leijen and Andres Löh. The International Conference on Functional Programming (ICFP'05), Tallin, Estonia. September 2005.

ML-F is a type system that extends a functional language with impredicative rank-|n| polymorphism. Type inference remains possible and only in some clearly defined situations, a local type annotation is required. Qualified types are a general concept that can accomodate a wide range of type systems extension, for example, type classes in Haskell. We show how the theory of qualified types can be used seamlessly with the higher-ranked impredicative polymorphism of ML-F. A core contribution of the paper is that we show a solution to the non-trivial problem of evidence translation in the presence of impredicative data types. (Note: one can experiment with MLF types with the experimental Morrow interpreter. However, this does not yet implement the qualified type extension discussed in the paper)

wxHaskell – A portable and concise GUI library for Haskell. [bib, pdf]

Daan Leijen. The ACM SIGPLAN Haskell workshop, Snowbird, Utah, September 22, 2004.

wxHaskell is a graphical user interface (GUI) library for Haskell that is built on wxWidgets: a free industrial strength GUI library for C++ that provides a common interface that has been ported to all major platforms, including Windows, Gtk, and MacOS X. In contrast with many other libraries, wxWidgets retains the native lookand-feel of each particular platform. We show how distinctive features of Haskell, like parametric polymorphism, higher-order functions, and first-class computations, can be used to present a concise and elegant monadic interface for portable GUI programs.

Functioneel programmeren met Helium [bib, pdf (in Dutch)]
Bastiaan Heeren and Daan Lijen, Best paper at NIOC'04, The Netherlands, November 2004.

Moderne functionele talen zijn mathematisch precies, notationeel elegant, en sterk getypeerd. Deze talen zijn daarom bij uitstek geschikt voor het onderwijzen van programmeerconcepten en algoritmiek. Helium is een onderzoeksproject waarbij een krachtig typesysteem gecombineerd wordt met precieze en gebruiksvriendelijke foutmeldingen.

First-class labels for extensible rows. [bib, pdf]

Daan Leijen. Technical Report UU-CS-2004-51, Departement of Computer Science, Universiteit Utrecht, 2004.

This paper describes a type system for extensible records and variants with first-class labels; labels are polymorphic and can be passed as arguments. This increases the expressiveness of conventional record calculi significantly, and we show how we can encode intersection types, closed-world overloading, type case, label selective calculi, and first-class messages. We formally motivate the need for row equality predicates to express type constraints in the presence of polymorphic labels. This naturally leads to an orthogonal treatment of unrestricted row polymorphism that can be used to express first-class patterns. Based on the theory of qualified types, we present an effective type inference algorithm and efficient compilation method.

Gebruikersvriendelijke compiler voor het onderwijs. [pdf (in Dutch, ~800k)]
Invited article with Bastiaan Heeren for the monthly magazine Informatie, 46/8, October 2004.

Foutmeldingen van compilers zijn vaak moeilijk te interpreteren. Om het programmeeronderwijs te verbeteren wordt aan de Universiteit Utrecht de Helium compiler ontwikkeld die precieze, gebruikersvriendelijke foutmeldingen genereerd.

The λ Abroad – A Functional Approach to Software Components. [bib, pdf ~1mb]

Daan Leijen. PhD Thesis, Department of Computer Science, Utrecht University, November 2003.

Helium, for Learning Haskell. [bib, pdf]

Joint work with Arjan van IJzendoorn and Bastiaan Heeren. The ACM SIGPLAN Haskell workshop, pages 62–71, Uppsala, Sweden, August 28, 2003.

Helium is a user-friendly compiler designed especially for learning the functional programming language Haskell. The quality of the error messages has been the main concern both in the choice of the language features and in the implementation of the compiler. Helium implements almost full Haskell, where the most notable difference is the absence of type classes. Our goal is to let students learn functional programming more quickly and with more fun. The compiler has been successfully employed in two introductory programming courses at Utrecht University. (See also the Helium homepage.)

Division and Modulus for Computer Scientists [pdf, pdf-letter]

Daan Leijen. Short note about division definitions in programming languages, 2003.

There exist many definitions of the div and mod functions in computer science literature and programming languages. We briefly review the most common definitions (truncated division, Knuth's floored division, etc.) and discuss the rare, but mathematically elegant, Euclidean division. We also give an algorithm for the Euclidean div and mod functions and prove it correct with respect to Euclid's theorem.

Parsec: Direct Style Monadic Parser Combinators for the Real World [bib, pdf, pdf-letter]

Daan Leijen and Erik Meijer. Technical Report UU-CS-2001-35, Departement of Computer Science, Universiteit Utrecht, 2001.

Despite the long list of publications on parser combinators, there does not yet exist a monadic parser combinator library that is applicable in real world situations. In particular naive implementations of parser combinators are likely to suffer from space leaks and are often unable to report precise error messages in case of parse errors. The Parsec parser combinator library described in this paper, utilizes a novel implementation technique for space and time efficient parser combinators that in case of a parse error, report both the position of the error as well as all grammar productions that would have been legal at that point in the input. (see also the Parsec homepage).

Domain Specific Embedded Compilers [bib, ps]

Daan Leijen and Erik Meijer. 2nd USENIX Conference on Domain-Specific Languages (DSL'99), Austin, Texas, October 1999. Also appeared in ACM SIGPLAN Notices 35, 1, January 2000.

Domain-specific embedded languages (DSELs) expressed in higher-order, typed (HOT) languages provide a composable framework for domain-specific abstractions. Such a framework is of greater utility than a collection of stand-alone domain-specific languages. Usually, embedded domain specific languages are build on top of a set of domain specific primitive functions that are ultimately implemented using some form of foreign function call. We sketch a general design pattern for embedding client-server style services into Haskell using a domain specific embedded compiler for the server's source language. In particular we apply this idea to implement HaskellDB, a domain specific embedded compiler that dynamically generates of SQL queries from monad comprehensions, which are then executed on an arbitrary ODBC database server.

Calling Hell from Heaven and Heaven from Hell [bib, ps]

Sigbjorn Finne, Daan Leijen, Erik Meijer, and Simon Peyton-Jones. Proceedings of the International Conference on Functional Programming (ICFP'99), Paris, France, 1999. Also appeared in ACM SIGPLAN Notices 34, 9, September 1999.

The increasing popularity of component-based programming tools offer a big opportunity to designers of advanced programming languages, such as Haskell. If we can package our programs as COM objects, then it is easy to integrate them into applications written in other languages. In earlier work we described a preliminary integration of Haskell with Microsoft's Component Object Model (COM), focusing on how Haskell can create and invoke COM objects. This paper develops that work, concentrating on the mechanisms that support externally-callable Haskell functions, and the encapsulation of a Haskell program as a COM object. See also the HaskellDirect homepage.

Haskell as an Automation controller [bib, ps]

Daan Leijen, Erik Meijer and James Hook. The 3rd International Summershool on Advanced Functional Programming, Volume 1608 of Springer Lecture Notes in Computer Science (LNCS), Braga, Portugal, 1999.

An introduction to using (automation) COM components from Haskell and how to write hybrid applications with Haskell, J++ and VB. All the examples discussed in the article are included in the HaskellScript release.

Client-side Web Scripting with HaskellScript [bib, ps]

Erik Meijer, Daan Leijen and James Hook. Proceedings of Practical Aspects of Declarative Languages (PADL), 1998.

Using client-side scripting it is possible to build interactive web pages that don't need round-trips to the server for every user-event. The web browser exposes itself to the script via an object model (DOM), which means that scripts can add and remove page content, or change the position and color of elements via their style attributes. We explain the object model as implemented by Microsoft Internet Explorer by means of examples and report on our experiences of using Haskell as a programming language for client-side web scripting using the HaskellScript scripting engine.

H/Direct: A binary language interface for Haskell [bib, ps]

Sigbjorn Finne, Simon Peyton-Jones, Erik Meijer and Daan Leijen. International Conference on Functional Programming (ICFP), Baltimore, USA, 1998. Also appeared in ACM SIGPLAN Notices 34, 1, January 1999.

H/Direct is a foreign-language interface for the purely functional language Haskell. Rather than rely on host-language type signatures, H/Direct compiles Interface Definition Language (IDL) to Haskell stub code that marshals data across the interface. This approach allows haskell to call both C and COM, and allows a Haskell component to be wrapped in a C or COM interface. IDL is a complex language and language mappings from IDL are usually described informally. In contrast, we provide a relatively formal and precise definition of the mapping between Haskell and IDL.

Scripting COM components in Haskell [bib, ps]

Simon L. Peyton-Jones, Erik Meijer and Daan Leijen. Fifth International Conference on Software Reuse (ICSR5), Victoria BC, Canada, June 1998.

The expresiveness of higher-order, typed languages such as Haskell or ML makes them an attractive medium in which to write software components. Hitherto, however, their use has been limited by the all-or-nothing problem: it is hardto write just part of an application in these languages. Component-based programming using a binary standard such as Microsofts's Component Object Model (COM) offers a solution to this dilemma, by specifying a language-independent interface between components. This paper reports about our experience with exploiting this opportunity in the purely funtional language Haskell. We describe a design for integrating COM components into Haskell programs, and we demonstrate why someone might want to script their COM components this way.

Functional Components, COM components in Haskell [bib, ps]

Daan Leijen. Master thesis, University of Amsterdam, June 1998.

This is my master thesis on which HaskellDirect is based. Contains lots of background information about COM and the Haskell to COM binding, together with some nice examples.

"Oct 18 2005"