2009Nottingham ePrints (University of Nottingham)Open access

A functional specification of effects

Wouter Swierstra

Open full text 18 citations

Abstract

Thesis submitted to the University of Nottingham for the degree of Doctor of Philosophy. This dissertation is about effects and type theory. Functional programming languages such as Haskell illustrate how to encapsulate side effects using monads. Haskell compilers provide a hand-ful of primitive effectful functions. Programmers can construct larger com-putations using the monadic return and bind operations. These primitive effectful functions, however, have no associated defini-tion. At best, their semantics are specified separately on paper. This can make it difficult to test, debug, verify, or even predict the behaviour of ef-fectful computations. This dissertation provides pure, functional specifications in Haskell of several different effects. Using these specifications, programmers can test and debug effectful programs. This is particularly useful in tandem with automatic testing tools such as QuickCheck. The specifications in Haskell are not total. This makes them unsuit-able for the formal verification of effectful functions. This dissertation over-comes this limitation, by presenting total functional specifications in Agda, a programming language with dependent types. There have been alternative approaches to incorporating effects in a de-pendently typed programming language. Most notably, recent work on Hoare Type Theory proposes to extend type theory with axioms that pos-tulate the existence of primitive effectful functions. This dissertation shows how the functional specifications implement these axioms, unifying the two approaches. The results presented in this dissertation may be used to write and ver-ify effectful programs in the framework of type theory. i

Open-access reader

About this research paper

What this paper is about

Thesis submitted to the University of Nottingham for the degree of Doctor of Philosophy. This dissertation is about effects and type theory. Functional programming languages such as Haskell illustrate how to encapsulate side effects using monads. Haskell compilers provide a hand-ful of primitive effectful functions. Programmers can construct larger com-putations using the monadic return and bind operations. These primitive effectful functions, however, have no associated defini-tion. At best, their semantics are specified separately on paper. This can make it difficult to test, debug, verify, or even predict the behaviour of ef-fectful computations. This dissertation provides pure, functional specifications in Haskell of several different effects. Using these specifications, programmers can test and debug effectful programs. This is particularly useful in tandem with automatic testing tools such as QuickCheck. The specifications in Haskell are not total. This makes them unsuit-able for the formal verification of effectful functions. This dissertation over-comes this limitation, by presenting total functional specifications in Agda, a programming language with dependent types. There have been alternative approaches to incorporating effects in a de-pendently typed programming language. Most notably, recent work on Hoare Type Theory proposes to extend type theory with axioms that pos-tulate the existence of primitive effectful functions. This dissertation shows how the functional specifications implement these axioms, unifying the two approaches. The results presented in this dissertation may be used to write and ver-ify effectful programs in the framework of type theory. i

Why it matters

OpenAlex reports 18 citations for this work. Citation counts describe recorded attention and do not establish research quality.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

Thesis submitted to the University of Nottingham for the degree of Doctor of Philosophy. This dissertation is about effects and type theory. Functional programming languages such as Haskell illustrate how to encapsulate side effects using monads. Haskell compilers provide a hand-ful of primitive effectful functions. Programmers can construct larger com-putations using the monadic return and bind operations. These primitive effectful functions, however, have no associated defini-tion. At best, their semantics are specified separately on paper. This can make it difficult to test, debug, verify, or even predict the behaviour of ef-fectful computations. This dissertation provides pure, functional specifications in Haskell of several different effects. Using these specifications, programmers can test and debug effectful programs. This is particularly useful in tandem with automatic testing tools such as QuickCheck. The specifications in Haskell are not total. This makes them unsuit-able for the formal verification of effectful functions. This dissertation over-comes this limitation, by presenting total functional specifications in Agda, a programming language with dependent types. There have been alternative approaches to incorporating effects in a de-pendently typed programming language. Most notably, recent work on Hoare Type Theory proposes to extend type theory with axioms that pos-tulate the existence of primitive effectful functions. This dissertation shows how the functional specifications implement these axioms, unifying the two approaches. The results presented in this dissertation may be used to write and ver-ify effectful programs in the framework of type theory. i

Key concepts: Haskell, Functional programming, Programming language, Computer science, Axiom, Type theory, Debugging, Compiler

Related papers

Back to paper searchBrowse research topicsOriginal source
A functional specification of effects — Research Paper | ScholarLens