1
0
mirror of https://github.com/dhil/phd-dissertation synced 2026-03-13 11:08:25 +00:00
This commit is contained in:
2021-05-24 11:49:38 +01:00
parent a462aa8a57
commit 7c3942a564
2 changed files with 66 additions and 18 deletions

View File

@@ -741,6 +741,19 @@
year = {2012} year = {2012}
} }
# "Proto handlers"
@inproceedings{CartwrightF94,
author = {Robert Cartwright and
Matthias Felleisen},
title = {Extensible Denotational Language Specifications},
booktitle = {{TACS}},
series = {Lecture Notes in Computer Science},
volume = {789},
pages = {244--272},
publisher = {Springer},
year = {1994}
}
# Applicative idioms # Applicative idioms
@article{McBrideP08, @article{McBrideP08,
author = {Conor McBride and author = {Conor McBride and
@@ -3532,3 +3545,13 @@
pages = {98--107}, pages = {98--107},
year = {1989} year = {1989}
} }
# Curry-Howard correspondence
@incollection{Howard80,
author = {William A. Howard},
title = {The Formulae-as-Types Notion of Construction},
booktitle = {To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism},
publisher = {Academic Press},
editor = {Haskell Curry and Hindley B. and Seldin J. Roger and P. Jonathan},
year = 1980
}

View File

@@ -371,15 +371,31 @@
\chapter{Introduction} \chapter{Introduction}
\label{ch:introduction} \label{ch:introduction}
% %
Functional programmers tend to view functions as impenetrable black Functional programmers tend to view programs as impenetrable opaque
boxes, whose outputs are determined entirely by their boxes, whose outputs are determined entirely by their
inputs~\cite{Hughes89}. This is a compelling view which admits a inputs~\cite{Hughes89,Howard80}. This is a compelling view which
canonical mathematical model of admits a canonical mathematical model of
computation~\cite{Church32,Church41}. computation~\cite{Church32,Church41}.
% %
Alas, this view does not capture the reality of practical programs, Alas, this view does not capture the reality of practical programs,
which must interact with their environment (i.e. operating system) to which perform operations to interact with their ambient environment to
facilitate file I/O\dots for example signal graceful or erroneous termination, manipulate the
file system, fork a new thread, and so forth, all of which may have an
observable effect on the program state. Interactions with the
environment are mediated by some local authority (e.g. operating
system), which confers the meaning of operations~\cite{CartwrightF94}.
%
This suggests a view of programs as translucent boxes, which convey
their internal use of operations used to compute their outputs.
This view underpins the \emph{effectful programming paradigm} in which
computational effects constitute an integral part of programs. In
effectful programming a computational effect is understood as a
collection of operations, e.g. exceptions are an effect with a single
operation \emph{raise}, mutable state is an effect with two operations
\emph{get} and \emph{put}, concurrency is an effect with two
operations \emph{fork} and \emph{yield}, etc~\cite{Moggi91,PlotkinP01}.
% Alas, this view does not capture the reality of practical programs, which % Alas, this view does not capture the reality of practical programs, which
% may use a variety of observable computational effects such as % may use a variety of observable computational effects such as
% exceptions, state, concurrency, interactive input/output, and so % exceptions, state, concurrency, interactive input/output, and so
@@ -405,18 +421,27 @@ Functional programming offers two distinct, but related, approaches to
effectful programming, which \citet{Filinski96} succinctly effectful programming, which \citet{Filinski96} succinctly
characterises as \emph{effects as data} and \emph{effects as characterises as \emph{effects as data} and \emph{effects as
behaviour}. The former uses monads to encapsulate behaviour}. The former uses monads to encapsulate
effects~\cite{Moggi91,Wadler92} which is compelling because it extends effects~\cite{Moggi91,Wadler92} which is compelling because it
the black box view to effectful functions, though, at the expense of a recovers some of benefits of the opaque box view for effectful
change of programming style~\cite{JonesW93}. The latter retains the programs, though, at the expense of a change of programming
usual direct style of programming by way of \emph{first-class style~\cite{JonesW93}. The latter retains the usual direct style of
control}, which is a powerful facility that can simulate any programming by way of \emph{first-class control}, which is a powerful
effect~\cite{Filinski94,Filinski96}. First-class control enables the facility that can simulate any computational
programmer to manipulate and reify the control state as a first-class effect~\cite{Filinski94,Filinski96}.
data object known as a continuation~\cite{FriedmanHK84}. First-class
control has the ability pry open function boundaries, which fractures \citeauthor{PlotkinP09}'s \emph{effect handlers} are a recent
the black box view of computation. This ability can significantly innovation\dots
improve the computational expressiveness and efficiency of programming
languages~\cite{LongleyN15,HillerstromLL20}. % First-class control enables the programmer to reify and manipulate the
% control state as a first-class data object known as a
% continuation~\cite{FriedmanHK84}.
%
% Programmers with continuations at their disposal have the ability to
% pry open function boundaries, which shatters the opaque box view. This
% ability can significantly improve the computational expressiveness and
% efficiency of programming languages~\cite{LongleyN15,HillerstromLL20}.
effect handlers, a recent innovation, effect handlers, a recent innovation,