Results 1 -
5 of
5
ML module mania: A type-safe, separately compiled, extensible interpreter
- In ML workshop
, 2004
"... ML provides unusually powerful mechanisms for building programs from ..."
Abstract
-
Cited by 5 (0 self)
- Add to MetaCart
ML provides unusually powerful mechanisms for building programs from
Asymptotic Improvement of Computations over Free Monads
- In Proceedings, Mathematics of Program Construction
, 2008
"... Abstract. We present a low-effort program transformation to improve the efficiency of computations over free monads in Haskell. The development is calculational and carried out in a generic setting, thus applying to a variety of datatypes. An important aspect of our approach is the utilisation of ty ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Abstract. We present a low-effort program transformation to improve the efficiency of computations over free monads in Haskell. The development is calculational and carried out in a generic setting, thus applying to a variety of datatypes. An important aspect of our approach is the utilisation of type class mechanisms to make the transformation as transparent as possible, requiring no restructuring of code at all. There is also no extra support necessary from the compiler (apart from an up-to-date type checker). Despite this simplicity of use, our technique is able to achieve true asymptotic runtime improvements. We demonstrate this by examples for which the complexity is reduced from quadratic to linear. 1
Semantics First! Rethinking the Language Design Process
- In Int. Conf. on Software Language Engineering, LNCS 6940
, 2011
"... Abstract The design of languages is still more of an art than an engineering discipline. Although recently tools have been put forward to support the language design process, such as language workbenches, these have mostly focused on a syntactic view of languages. While these tools are quite helpful ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Abstract The design of languages is still more of an art than an engineering discipline. Although recently tools have been put forward to support the language design process, such as language workbenches, these have mostly focused on a syntactic view of languages. While these tools are quite helpful for the development of parsers and editors, they provide little support for the underlying design of the languages. In this paper we illustrate how to support the design of languages by focusing on their semantics first. Specifically, we will show that powerful and general language operators can be employed to adapt and grow sophisticated languages out of simple semantics concepts. We use Haskell as a metalanguage and will associate generic language concepts, such as semantics domains, with Haskell-specific ones, such as data types. We do this in a way that clearly distinguishes our approach to language design from the traditional syntaxoriented one. This will reveal some unexpected correlations, such as viewing type classes as language multipliers. We illustrate the viability of our approach with several real-world examples. 1
Chapter 22 Matching and Modifying with
"... Abstract: Haskell has powerful features such as pattern matching and recursive data types for building tree structures easily. These features are not without problems, however: patterns are not composable and cannot be abbreviated; it can be hard to modify a specific part of a large tree structure w ..."
Abstract
- Add to MetaCart
Abstract: Haskell has powerful features such as pattern matching and recursive data types for building tree structures easily. These features are not without problems, however: patterns are not composable and cannot be abbreviated; it can be hard to modify a specific part of a large tree structure without unique identifiers. This paper explains how a particular Haskell generics approach, Scrap Your Boilerplate, can be used to solve both of these problems in Haskell, without the need for meta-programming or new language features. Haskell allows programmers to use pattern matching in several contexts, most notably function equations, to match data structures and bind variables. One problem with Haskell’s pattern matching is that the entirety of a pattern must be written together; patterns are not composable or reusable. In addition, pattern
A pattern for almost . . .
, 2008
"... This paper introduces a pattern for almost compositional functions over recursive data types, and over families of mutually recursive data types. Here “almost compositional ” means that for all of the constructors in the type(s), except a limited number of them, the result of the function depends on ..."
Abstract
- Add to MetaCart
This paper introduces a pattern for almost compositional functions over recursive data types, and over families of mutually recursive data types. Here “almost compositional ” means that for all of the constructors in the type(s), except a limited number of them, the result of the function depends only on the constructor and the results of calling the function on the constructor’s arguments. The pattern consists of a generic part constructed once for each data type or family of data types, and a task-specific part. The generic part contains the code for the predictable compositional cases, leaving the interesting work to the task-specific part. Examples of the pattern are given, implemented in dependent type theory with inductive families, in Haskell with generalized algebraic data types and rank-2 polymorphism, and in Java using a variant of the Visitor design pattern. The relationships to the “Scrap Your Boilerplate” approach to generic programming, and to general tree types in dependent type theory, are investigated by reimplementing our operations using those frameworks.

