Results 1 
9 of
9
Once Upon a Type
 In Functional Programming Languages and Computer Architecture
, 1995
"... A number of useful optimisations are enabled if we can determine when a value is accessed at most once. We extend the HindleyMilner type system with uses, yielding a typeinference based program analysis which determines when values are accessed at most once. Our analysis can handle higherorder fun ..."
Abstract

Cited by 89 (2 self)
 Add to MetaCart
A number of useful optimisations are enabled if we can determine when a value is accessed at most once. We extend the HindleyMilner type system with uses, yielding a typeinference based program analysis which determines when values are accessed at most once. Our analysis can handle higherorder functions and data structures, and admits principal types for terms. Unlike previous analyses, we prove our analysis sound with respect to callbyneed reduction. Callbyname reduction does not provide an accurate model of how often a value is used during lazy evaluation, since it duplicates work which would actually be shared in a real implementation. Our type system can easily be modified to analyse usage in a callbyvalue language. 1 Introduction This paper describes a method for determining when a value is used at most once. Our method is based on a simple modification of the HindleyMilner type system. Each type is labelled to indicate whether the corresponding value is used at most onc...
Compilation by Transformation in NonStrict Functional Languages
, 1995
"... In this thesis we present and analyse a set of automatic sourcetosource program transformations that are suitable for incorporation in optimising compilers for lazy functional languages. These transformations improve the quality of code in many different respects, such as execution time and memory ..."
Abstract

Cited by 44 (1 self)
 Add to MetaCart
In this thesis we present and analyse a set of automatic sourcetosource program transformations that are suitable for incorporation in optimising compilers for lazy functional languages. These transformations improve the quality of code in many different respects, such as execution time and memory usage. The transformations presented are divided in two sets: global transformations, which are performed once (or sometimes twice) during the compilation process; and a set of local transformations, which are performed before and after each of the global transformations, so that they can simplify the code before applying the global transformations and also take advantage of them afterwards. Many of the local transformations are simple, well known, and do not have major effects on their own. They become important as they interact with each other and with global transformations, sometimes in nonobvious ways. We present how and why they improve the code, and perform extensive experiments wit...
Context Patterns in Haskell
 In 8th Int. Workshop on Implementation of Functional Languages, LNCS 1268
, 1996
"... In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root ..."
Abstract

Cited by 9 (2 self)
 Add to MetaCart
In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root of the whole term. The semantics of context patterns is defined by transforming them to standard Haskell programs. Typical applications of context patterns are functions which search a data structure and possibly transform it. This concept can easily be adopted for other languages using pattern matching like ML or Clean.
On the Safety of Nöcker’s Strictness Analysis
 FRANKFURT AM MAIN, GERMANY
"... This paper proves correctness of Nöcker’s method of strictness analysis, implemented for Clean, which is an effective way for strictness analysis in lazy functional languages based on their operational semantics. We improve upon the work of Clark, Hankin and Hunt, which addresses correctness of the ..."
Abstract

Cited by 8 (7 self)
 Add to MetaCart
This paper proves correctness of Nöcker’s method of strictness analysis, implemented for Clean, which is an effective way for strictness analysis in lazy functional languages based on their operational semantics. We improve upon the work of Clark, Hankin and Hunt, which addresses correctness of the abstract reduction rules. Our method also addresses the cycle detection rules, which are the main strength of Nöcker’s strictness analysis. We reformulate Nöcker’s strictness analysis algorithm in a higherorder lambdacalculus with case, constructors, letrec, and a nondeterministic choice operator ⊕ used as a union operator. Furthermore, the calculus is expressive enough to represent abstract constants like Top or Inf. The operational semantics is a smallstep semantics and equality of expressions is defined by a contextual semantics that observes termination of expressions. The correctness of several reductions is proved using a context lemma and complete sets of forking and commuting diagrams. The
Losing Functions without Gaining Data – another look at defunctionalisation
"... We describe a transformation which takes a higherorder program, and produces an equivalent firstorder program. Unlike Reynoldsstyle defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. We can use our method to improve t ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
We describe a transformation which takes a higherorder program, and produces an equivalent firstorder program. Unlike Reynoldsstyle defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. We can use our method to improve the results of existing analysis operations, including strictness analysis, patternmatch safety and termination checking. Our transformation is implemented, and works on a Core language to which Haskell programs can be reduced. Our method cannot always succeed in removing all functional values, but in practice is remarkably successful. D.3 [Software]: Program
Realising nondeterministic I/O in the Glasgow Haskell Compiler
, 2003
"... In this paper we demonstrate how to relate the semantics given by the nondeterministic callbyneed calculus FUNDIO [SS03] to Haskell. After introducing new correct program transformations for FUNDIO, we translate the core language used in the Glasgow Haskell Compiler into the FUNDIO language, where ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
In this paper we demonstrate how to relate the semantics given by the nondeterministic callbyneed calculus FUNDIO [SS03] to Haskell. After introducing new correct program transformations for FUNDIO, we translate the core language used in the Glasgow Haskell Compiler into the FUNDIO language, where the IO construct of FUNDIO corresponds to directcall IOactions in Haskell. We sketch the investigations of [Sab03b] where a lot of program transformations performed by the compiler have been shown to be correct w.r.t. the FUNDIO semantics. This enabled us to achieve a FUNDIOcompatible Haskellcompiler, by turning off not yet investigated transformations and the small set of incompatible transformations. With this compiler, Haskell programs which use the extension unsafePerformIO
Using rewriting to synthesize functional languages to digital circuits
 In Proc. Trends in Functional Programming (TFP), Lecture Notes in Computer Science
, 2014
"... Abstract. A straightforward synthesis from functional languages to digital circuits transforms variables to wires. The types of these variables determine the bitwidth of the wires. Assigning a bitwidth to polymorphic and functiontype variables within this direct synthesis scheme is impossible. ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
Abstract. A straightforward synthesis from functional languages to digital circuits transforms variables to wires. The types of these variables determine the bitwidth of the wires. Assigning a bitwidth to polymorphic and functiontype variables within this direct synthesis scheme is impossible. Using a term rewrite system, polymorphic and functiontype binders can be completely eliminated from a circuit description, given only minor and reasonable restrictions on the input. The presented term rewrite system is used in the compiler for CλaSH: a polymorphic, higherorder, functional hardware description language. 1
A Partial Rehabilitation of SideEffecting I/O: NonDeterminism in NonStrict Functional Languages
, 1996
"... We investigate the extension of nonstrict functional languages like Haskell or Clean by a nondeterministic interaction with the external world. Using callbyneed and a natural semantics which describes the reduction of graphs, this can be done such that the ChurchRosser Theorems 1 and 2 hold. Ou ..."
Abstract
 Add to MetaCart
We investigate the extension of nonstrict functional languages like Haskell or Clean by a nondeterministic interaction with the external world. Using callbyneed and a natural semantics which describes the reduction of graphs, this can be done such that the ChurchRosser Theorems 1 and 2 hold. Our operational semantics is a base to recognise which particular equivalencies are preserved by program transformations. The amount of sequentialisation may be smaller than that enforced by other approaches, and the programming style is closer to the common one of sideeffecting programming. However, not all program transformations used by an optimising compiler for Haskell remain correct in all contexts. Our result can be interpreted as a possibility to extend current I/Omechanism by nondeterministic memoryless function calls. For example, this permits a call to a random number generator. Adding memoryless function calls to monadic I/O is possible and has a potential to extend the Haskell I...
Losing Functions without Gaining Data – a new method for defunctionalisation
"... We describe an automated transformation which takes a higherorder program, and a produces an equivalent firstorder program. Unlike Reynolds style defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. Our transformation ..."
Abstract
 Add to MetaCart
(Show Context)
We describe an automated transformation which takes a higherorder program, and a produces an equivalent firstorder program. Unlike Reynolds style defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. Our transformation is implemented, and works on a Core language to which Haskell programs can be reduced. Our method cannot always succeed in removing all functional values, but in practice it is remarkably successful.