Results 1  10
of
23
Monadic Parser Combinators
, 1996
"... In functional programming, a popular approach to building recursive descent parsers is to model parsers as functions, and to define higherorder functions (or combinators) that implement grammar constructions such as sequencing, choice, and repetition. Such parsers form an instance of a monad, an al ..."
Abstract

Cited by 57 (2 self)
 Add to MetaCart
In functional programming, a popular approach to building recursive descent parsers is to model parsers as functions, and to define higherorder functions (or combinators) that implement grammar constructions such as sequencing, choice, and repetition. Such parsers form an instance of a monad, an algebraic structure from mathematics that has proved useful for addressing a number of computational problems. The purpose of this article is to provide a stepbystep tutorial on the monadic approach to building functional parsers, and to explain some of the benefits that result from exploiting monads. No prior knowledge of parser combinators or of monads is assumed. Indeed, this article can also be viewed as a first introduction to the use of monads in programming.
Lag, Drag, Void and Use  Heap Profiling and SpaceEfficient Compilation Revisited
 In Proc. Intl. Conf. on Functional Programming
, 1996
"... The context for this paper is functional computation by graph reduction. Our overall aim is more efficient use of memory. The specific topic is the detection of dormant cells in the live graph  those retained in heap memory though not actually playing a useful role in computation. We describe a p ..."
Abstract

Cited by 15 (2 self)
 Add to MetaCart
The context for this paper is functional computation by graph reduction. Our overall aim is more efficient use of memory. The specific topic is the detection of dormant cells in the live graph  those retained in heap memory though not actually playing a useful role in computation. We describe a profiler that can identify heap consumption by such `useless' cells. Unlike heap profilers based on traversals of the live heap, this profiler works by examining cells postmortem. The new profiler has revealed a surprisingly large proportion of `useless' cells, even in some programs that previously seemed spaceefficient such as the bootstrapping Haskell compiler nhc. 1 Introduction A typical computation by graph reduction involves a large and changing population of heapmemory cells. Taking a census of this population at regular intervals can be very instructive, both for functional programmers and for functionallanguage implementors. A heap profiler [RW93] records population counts for ...
Combinator parsing: A short tutorial
 Language Engineering and Rigorous Software Development, International LerNet ALFA Summer School 2008, Piriapolis, Uruguay, February 24–March 1, 2008, Revised Tutorial Lectures. Volume 5520 of Lecture Notes in Computer Science., SpringerVerlag (2009) 252–
"... Abstract. There are numerous ways to implement a parser for a given syntax; using parser combinators is a powerful approach to parsing which derives much of its power and expressiveness from the type system and semantics of the host programming language. This tutorial begins with the construction of ..."
Abstract

Cited by 9 (2 self)
 Add to MetaCart
Abstract. There are numerous ways to implement a parser for a given syntax; using parser combinators is a powerful approach to parsing which derives much of its power and expressiveness from the type system and semantics of the host programming language. This tutorial begins with the construction of a small library of parsing combinators. This library introduces the basics of combinator parsing and, more generally, demonstrates how domain specific embedded languages are able to leverage the facilities of the host language. After having constructed our small combinator library, we investigate some shortcomings of the naïve implementation introduced in the first part, and incrementally develop an implementation without these problems. Finally we discuss some further extensions of the presented library and compare our approach with similar libraries. 1
Total Parser Combinators
, 2009
"... A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library’s interface is similar to that of many other parser combinator libraries, with two important differences: one is that the interface clearly specif ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library’s interface is similar to that of many other parser combinator libraries, with two important differences: one is that the interface clearly specifies which parts of the constructed parsers may be infinite, and which parts have to be finite, using a combination of induction and coinduction; and the other is that the parser type is unusually informative. The library comes with a formal semantics, using which it is proved that the parser combinators are as expressive as possible. The implementation
New Dimensions in Heap Profiling
 JOURNAL OF FUNCTIONAL PROGRAMMING
, 1996
"... Firstgeneration heap profilers for lazy functional languages have proved to be effective tools for locating some kinds of space faults, but in other cases they cannot provide sufficient information to solve the problem. This paper describes the design, implementation and use of a new profiler that ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
Firstgeneration heap profilers for lazy functional languages have proved to be effective tools for locating some kinds of space faults, but in other cases they cannot provide sufficient information to solve the problem. This paper describes the design, implementation and use of a new profiler that goes beyond the twodimensional `who produces what' view of heap cells to provide information about their more dynamic and structural attributes. Specifically, the new profiler can distinguish between cells according to their eventual lifetime, or on the basis of the closure retainers by virtue of which they remain part of the live heap. A bootstrapping Haskell compiler (nhc) hosts the implementation: among examples of the profiler's use we include selfapplication to nhc. Another example is the original heapprofiling case study clausify, which now consumes even less memory and is much faster.
Lag, Drag and PostMortem Heap Profiling
"... The context for this paper is functional computation by graph reduction. Our overall aim is more efficient use of memory. The specific topic is the detection of dormant cells in the live graph  those retained in heap memory though not actually playing a useful role in computation. We describe a p ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
The context for this paper is functional computation by graph reduction. Our overall aim is more efficient use of memory. The specific topic is the detection of dormant cells in the live graph  those retained in heap memory though not actually playing a useful role in computation. We describe a profiler that can identify heap consumption by such `useless' cells. Unlike heap profilers based on traversals of the live heap, this profiler works by examining cells postmortem. Early experience with applications confirms our suspicions about spaceefficiency: as usual, it is even worse than expected! 1 Introduction A typical computation by graph reduction involves a large and changing population of heapmemory cells. Taking a census of this population at regular intervals can be very instructive, both for functional programmers and for functionallanguage implementors. A heap profiler [RW93] records population counts for different classes of cells (eg. representing different values, creat...
Data Field Haskell
, 1999
"... . Data fields provide a flexible and highly general model for indexed collections of data. Data Field Haskell is a Haskell dialect that provides an instance of data fields. It can be used for very generic collectionoriented programming, with a special emphasis on multidimensional structures. We ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
. Data fields provide a flexible and highly general model for indexed collections of data. Data Field Haskell is a Haskell dialect that provides an instance of data fields. It can be used for very generic collectionoriented programming, with a special emphasis on multidimensional structures. We give a brief description of the data field model and its underlying theory. We then describe Data Field Haskell, and an implementation. 1 Introduction Indexed data structures are important in many computing applications. The canonical indexed data structure is the array, but other indexed structures like hash tables and explicitly parallel entities are also common. In many applications the indexing capability provides an important part of the model: when solving partial differential equations, for instance, the index is often closely related to a physical coordinate, and explicitly parallel algorithms often use processor ID's as indices. Since the time of APL [5] it has been recognised ...
Partial parsing: combining choice with commitment
"... Abstract. Parser combinators, often monadic, are a venerable and widelyused solution to read data from some external format. However, the capability to return a partial parse has, until now, been largely missing. When only a small portion of the entire data is desired, it has been necessary either t ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Abstract. Parser combinators, often monadic, are a venerable and widelyused solution to read data from some external format. However, the capability to return a partial parse has, until now, been largely missing. When only a small portion of the entire data is desired, it has been necessary either to parse the entire input in any case, or to break up the grammar into smaller pieces and move some work outside the world of combinators. This paper presents a technique for mixing lazy, demanddriven, parsing with strict parsing, all within the same set of combinators. The grammar specification remains complete and unbroken, yet only sufficient input is consumed to satisfy the result demanded. It is built on a combination of applicative and monadic parsers. Monadic parsing alone is insufficient to allow a choice operator to coexist with the early commitment needed for lazy results. Applicative parsing alone can give partial results, but does not permit contextsensitive grammars. But used together, we gain both partiality and a flexible ease of use. Performance results demonstrate that partial parsing is often faster and more spaceefficient than strict parsing, but never worse. The tradeoff is that partiality has consequences when dealing with illformed input. 1
Expressive Power of Declarative Programming Languages
, 1998
"... The thesis investigates several aspects of the expressive power of declarative programming languages. There seems to be no widely accepted definition of expressive power of programming languages. In the literature expressiveness may mean power to describe algorithms, or to describe computations, or ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
The thesis investigates several aspects of the expressive power of declarative programming languages. There seems to be no widely accepted definition of expressive power of programming languages. In the literature expressiveness may mean power to describe algorithms, or to describe computations, or to check types, etc. Presenting a clearer idea of the expressiveness of programming languages is a part of the aim of the research. We concentrate on the expressive power of declarative languages because these languages are at the highest level of abstraction. People argue about relative expressiveness between declarative languages. Besides, there are two declarative paradigms: logic and functional programming. How can we define and compare expressive power of languages belonging to these two different paradigms ? In order to compare expressive power of logic and functional languages, several translation schemes from subsets of Prolog to Haskell are defined. During the translation we aim to ...