Results 1  10
of
15
A transformationbased optimiser for Haskell
, 1998
"... Many compilers do some of their work by means of correctnesspreserving, and hopefully performanceimproving, program transformations. The Glasgow Haskell Compiler (GHC) takes this idea of "compilation by transformation" as its warcry, trying to express as much as possible of the compilation proces ..."
Abstract

Cited by 84 (11 self)
 Add to MetaCart
Many compilers do some of their work by means of correctnesspreserving, and hopefully performanceimproving, program transformations. The Glasgow Haskell Compiler (GHC) takes this idea of "compilation by transformation" as its warcry, trying to express as much as possible of the compilation process in the form of program transformations. This paper reports on our practical experience of the transformational approach to compilation, in the context of a substantial compiler.
Compiling Haskell by program transformation: a report from the trenches
 In Proc. European Symp. on Programming
, 1996
"... Many compilers do some of their work by means of correctnesspreserving, and hopefully performanceimproving, program transformations. The Glasgow Haskell Compiler (GHC) takes this idea of "compilation by transformation" as its warcry, trying to express as much as possible of the compilation proces ..."
Abstract

Cited by 55 (4 self)
 Add to MetaCart
Many compilers do some of their work by means of correctnesspreserving, and hopefully performanceimproving, program transformations. The Glasgow Haskell Compiler (GHC) takes this idea of "compilation by transformation" as its warcry, trying to express as much as possible of the compilation process in the form of program transformations. This paper reports on our practical experience of the transformational approach to compilation, in the context of a substantial compiler. The paper appears in the Proceedings of the European Symposium on Programming, Linkoping, April 1996. 1 Introduction Using correctnesspreserving transformations as a compiler optimisation is a wellestablished technique (Aho, Sethi & Ullman [1986]; Bacon, Graham & Sharp [1994]). In the functional programming area especially, the idea of compilation by transformation has received quite a bit of attention (Appel [1992]; Fradet & Metayer [1991]; Kelsey [1989]; Kelsey & Hudak [1989]; Kranz [1988]; Steele [1978]). A ...
Monadic Encapsulation of Effects: A Revised Approach (Extended Version)
 Journal of Functional Programming
, 1999
"... Launchbury and Peyton Jones came up with an ingenious idea for embedding regions of imperative programming in a pure functional language like Haskell. The key idea was based on a simple modification of HindleyMilner's type system. Our first contribution is to propose a more natural encapsulation co ..."
Abstract

Cited by 28 (4 self)
 Add to MetaCart
Launchbury and Peyton Jones came up with an ingenious idea for embedding regions of imperative programming in a pure functional language like Haskell. The key idea was based on a simple modification of HindleyMilner's type system. Our first contribution is to propose a more natural encapsulation construct exploiting higherorder kinds, which achieves the same encapsulation effect, but avoids the ad hoc type parameter of the original proposal. The second contribution is a type safety result for encapsulation of strict state using both the original encapsulation construct and the newly introduced one. We establish this result in a more expressive context than the original proposal, namely in the context of the higherorder lambdacalculus. The third contribution is a type safety result for encapsulation of lazy state in the higherorder lambdacalculus. This result resolves an outstanding open problem on which previous proof attempts failed. In all cases, we formalize the intended implementations as simple bigstep operational semantics on untyped terms, which capture interesting implementation details not captured by the reduction semantics proposed previously. 1
Imperative functional programming with isabelle/hol
 In TPHOLs ’08: Proceedings of the 21st International Conference on Theorem Proving in Higher Order Logics
, 2008
"... Abstract. We introduce a lightweight approach for reasoning about programs involving imperative data structures using the proof assistant Isabelle/HOL. It is based on shallow embedding of programs, a polymorphic heap model using enumeration encodings and type classes, and a stateexception monad sim ..."
Abstract

Cited by 17 (3 self)
 Add to MetaCart
Abstract. We introduce a lightweight approach for reasoning about programs involving imperative data structures using the proof assistant Isabelle/HOL. It is based on shallow embedding of programs, a polymorphic heap model using enumeration encodings and type classes, and a stateexception monad similar to known counterparts from Haskell. Existing proof automation tools are easily adapted to provide a verification environment. The framework immediately allows for correct code generation to ML and Haskell. Two case studies demonstrate our approach: An arraybased checker for resolution proofs, and a more efficient bytecode verifier. 1
Fusion of Recursive Programs with Computational Effects
 Theor. Comp. Sci
, 2000
"... Fusion laws permit to eliminate various of the intermediate data structures that are created in function compositions. The fusion laws associated with the traditional recursive operators on datatypes cannot in general be used to transform recursive programs with effects. Motivated by this fact, t ..."
Abstract

Cited by 14 (4 self)
 Add to MetaCart
Fusion laws permit to eliminate various of the intermediate data structures that are created in function compositions. The fusion laws associated with the traditional recursive operators on datatypes cannot in general be used to transform recursive programs with effects. Motivated by this fact, this paper addresses the definition of two recursive operators on datatypes that capture functional programs with effects. Effects are assumed to be modeled by monads. The main goal is thus the derivation of fusion laws for the new operators. One of the new operators is called monadic unfold. It captures programs (with effects) that generate a data structure in a standard way. The other operator is called monadic hylomorphism, and corresponds to programs formed by the composition of a monadic unfold followed by a function defined by structural induction on the data structure that the monadic unfold generates. 1 Introduction A common approach to program design in functional programmin...
Plogic: property verification for Haskell programs
, 2002
"... Proofsupported logical verification of program properties has been a topic of research interest for more than 30 years. The feasibility of proof construction as a verification technique has been demonstrated through many examples of its application, yet it remains a technique rarely used in prac ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Proofsupported logical verification of program properties has been a topic of research interest for more than 30 years. The feasibility of proof construction as a verification technique has been demonstrated through many examples of its application, yet it remains a technique rarely used in practice for a variety of reasons, both technical and sociological. The lack of verification logics for modern programming languages remains a strong deterrent to the use of proofsupported verification.
Towards Merging Recursion and Comonads
, 2000
"... Comonads are mathematical structures that account naturally for effects that derive from the context in which a program is executed. This paper reports ongoing work on the interaction between recursion and comonads. Two applications are shown that naturally lead to versions of a comonadic fold op ..."
Abstract

Cited by 9 (2 self)
 Add to MetaCart
Comonads are mathematical structures that account naturally for effects that derive from the context in which a program is executed. This paper reports ongoing work on the interaction between recursion and comonads. Two applications are shown that naturally lead to versions of a comonadic fold operator on the product comonad. Both versions capture functions that require extra arguments for their computation and are related with the notion of strong datatype. 1 Introduction One of the main features of recursive operators derivable from datatype definitions is that they impose a structure upon programs which can be exploited for program transformation. Recursive operators structure functional programs according to the data structures they traverse or generate and come equipped with a battery of algebraic laws, also derivable from type definitions, which are used in program calculations [24, 11, 5, 15]. Some of these laws, the socalled fusion laws, are particularly interesting in p...
The Brisk Project: Concurrent and Distributed Functional Systems
 In Glasgow Functional Programming Workshop, Ullapool
, 1995
"... ©Copyright in this paper belongs to the author(s) Published in collaboration with the ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
©Copyright in this paper belongs to the author(s) Published in collaboration with the
Monadic Corecursion  Definition, Fusion Laws, and Applications
 Electronic Notes in Theoretical Computer Science
, 1998
"... This paper investigates corecursive definitions which are at the same time monadic. This corresponds to functions that generate a data structure following a corecursive process, while producing a computational effect modeled by a monad. We introduce a functional, called monadic anamorphism, that cap ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
This paper investigates corecursive definitions which are at the same time monadic. This corresponds to functions that generate a data structure following a corecursive process, while producing a computational effect modeled by a monad. We introduce a functional, called monadic anamorphism, that captures definitions of this kind. We also explore another class of monadic recursive functions, corresponding to the composition of a monadic anamorphism followed by (the lifting of) a function defined by structural recursion on the data structure that the monadic anamorphism generates. Such kind of functions are captured by socalled monadic hylomorphism. We present transformation laws for these monadic functionals. Two nontrivial applications are also described.
Malloc Pointers and Stable Pointers: Improving Haskell's Foreign Language Interface
 In Glasgow Functional Programming Workshop Draft Proceedings
, 1994
"... The Glasgow Haskell compiler provides a foreign language interface which allows Haskell programs to call arbitrary C functions. This has been used both to implement the standard Haskell IO system and a variety of applications including an arcade game [8], and a graphical user interface to a database ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
The Glasgow Haskell compiler provides a foreign language interface which allows Haskell programs to call arbitrary C functions. This has been used both to implement the standard Haskell IO system and a variety of applications including an arcade game [8], and a graphical user interface to a database [19]. The theoretical problems associated with using impure functions from pure functional languages are avoided through the use of monads [17]; and the mismatch between strict languages with no garbage collection and lazy languages with garbage collection is tackled by unboxing (that is, forcing evaluation of arguments and stripping off any header information) [15]. Whilst this works well for simple examples, it is unsuitable when one wants to pass arguments (or results) which are lazy, polymorphic or very large. We describe two extensions to the garbage collector which solve these problems by allowing better interaction between the Haskell garbage collector and memory allocation in the im...