0% found this document useful (0 votes)
279 views65 pages

Programming in Haskell Second Edition, 5Th Printing Edition Hutton All Chapter Instant Download

Haskell

Uploaded by

dussokotykfc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
279 views65 pages

Programming in Haskell Second Edition, 5Th Printing Edition Hutton All Chapter Instant Download

Haskell

Uploaded by

dussokotykfc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Programming in Haskell Second Edition, 5Th


Printing Edition Hutton

https://textbookfull.com/product/programming-in-haskell-
second-edition-5th-printing-edition-hutton/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Programming in Haskell 2nd Edition Graham Hutton

https://textbookfull.com/product/programming-in-haskell-2nd-edition-
graham-hutton/

textboxfull.com

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/

textboxfull.com

Thinking with Types Type level Programming in Haskell


Sandy Maguire

https://textbookfull.com/product/thinking-with-types-type-level-
programming-in-haskell-sandy-maguire/

textboxfull.com

Haskell The Ultimate Beginner s Guide to Learn Haskell


Programming Step by Step 1st Edition Claudia Alves

https://textbookfull.com/product/haskell-the-ultimate-beginner-s-
guide-to-learn-haskell-programming-step-by-step-1st-edition-claudia-
alves/
textboxfull.com
The Haskell Road to Logic Maths and Programming Kees Doets

https://textbookfull.com/product/the-haskell-road-to-logic-maths-and-
programming-kees-doets/

textboxfull.com

The Information Bomb Radical Thinkers Second Printing


Edition Virilio Paul

https://textbookfull.com/product/the-information-bomb-radical-
thinkers-second-printing-edition-virilio-paul/

textboxfull.com

Programming Microsoft Dynamics NAV 5th Edition Mark


Brummel

https://textbookfull.com/product/programming-microsoft-dynamics-
nav-5th-edition-mark-brummel/

textboxfull.com

PostgreSQL Server Programming - Second Edition Dar

https://textbookfull.com/product/postgresql-server-programming-second-
edition-dar/

textboxfull.com

Copyright's Highway: From the Printing Press to the Cloud,


Second Edition Paul Goldstein

https://textbookfull.com/product/copyrights-highway-from-the-printing-
press-to-the-cloud-second-edition-paul-goldstein/

textboxfull.com
Programming in Haskell
Second Edition
Haskell is a purely functional language that allows programmers to
rapidly develop clear, concise and correct software. The language
has grown in popularity in recent years, both in teaching and in
industry. This book is based on the author’s experience of teaching
Haskell for more than 20 years. All concepts are explained from first
principles and no programming experience is required, making this
book accessible to a broad spectrum of readers. While Part I focuses
on basic concepts, Part II introduces the reader to more advanced
topics.
This new edition has been extensively updated and expanded to
include recent and more advanced features of Haskell, new
examples and exercises, selected solutions, and freely downloadable
lecture slides and code. The presentation is clean and simple, while
also being fully compliant with the latest version of the language,
including recent changes concerning applicative, monadic, foldable
and traversable types.
GRAHAM HUTTON is Professor of Computer Science at the University of
Nottingham. He has taught Haskell to thousands of students and
received numerous best lecturer awards. Hutton has served as an
editor of the Journal of Functional Programming, chair of the Haskell
Symposium and the International Conference on Functional
Programming, vice-chair of the ACM Special Interest Group on
Programming Languages, and he is an ACM Distinguished Scientist.
Programming in Haskell
Second Edition

GRAHAM HUTTON
University of Nottingham
University Printing House, Cambridge CB2 8BS, United Kingdom

One Liberty Plaza, 20th Floor, New York, NY 10006, USA


477 Williamstown Road, Port Melbourne, VIC 3207, Australia
4843/24, 2nd Floor, Ansari Road, Daryaganj, Delhi - 110002, India
79 Anson Road, #06-04/06, Singapore 079906

Cambridge University Press is part of the University of Cambridge.

It furthers the University’s mission by disseminating knowledge in the pursuit of education,


learning, and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.org/9781316626221
10.1017/9781316784099

© Graham Hutton 2007, 2016

This publication is in copyright. Subject to statutory exception and to the provisions of


relevant collective licensing agreements, no reproduction of any part may take place
without the written permission of Cambridge University Press.

First published 2007


Second edition 2016

Printed in the United Kingdom by Clays, St Ives plc in 2016

A catalogue record for this publication is available from the British Library

ISBN 978-1-316-62622-1 Paperback

Cambridge University Press has no responsibility for the persistence or accuracy of URLs for
external or third-party Internet Web sites referred to in this publication, and does not
guarantee that any content on such Web sites is, or will remain, accurate or appropriate.
For Annette, Callum and Tom
Contents

Foreword
Preface

Part I Basic Concepts


1 Introduction
1.1 Functions
1.2 Functional programming
1.3 Features of Haskell
1.4 Historical background
1.5 A taste of Haskell
1.6 Chapter remarks
1.7 Exercises

2 First steps
2.1 Glasgow Haskell Compiler
2.2 Installing and starting
2.3 Standard prelude
2.4 Function application
2.5 Haskell scripts
2.6 Chapter remarks
2.7 Exercises

3 Types and classes


3.1 Basic concepts
3.2 Basic types
3.3 List types
3.4 Tuple types
3.5 Function types
3.6 Curried functions
3.7 Polymorphic types
3.8 Overloaded types
3.9 Basic classes
3.10 Chapter remarks
3.11 Exercises

4 Defining functions
4.1 New from old
4.2 Conditional expressions
4.3 Guarded equations
4.4 Pattern matching
4.5 Lambda expressions
4.6 Operator sections
4.7 Chapter remarks
4.8 Exercises

5 List comprehensions
5.1 Basic concepts
5.2 Guards
5.3 The zip function
5.4 String comprehensions
5.5 The Caesar cipher
5.6 Chapter remarks
5.7 Exercises

6 Recursive functions
6.1 Basic concepts
6.2 Recursion on lists
6.3 Multiple arguments
6.4 Multiple recursion
6.5 Mutual recursion
6.6 Advice on recursion
6.7 Chapter remarks
6.8 Exercises

7 Higher-order functions
7.1 Basic concepts
7.2 Processing lists
7.3 The foldr function
7.4 The foldl function
7.5 The composition operator
7.6 Binary string transmitter
7.7 Voting algorithms
7.8 Chapter remarks
7.9 Exercises

8 Declaring types and classes


8.1 Type declarations
8.2 Data declarations
8.3 Newtype declarations
8.4 Recursive types
8.5 Class and instance declarations
8.6 Tautology checker
8.7 Abstract machine
8.8 Chapter remarks
8.9 Exercises

9 The countdown problem


9.1 Introduction
9.2 Arithmetic operators
9.3 Numeric expressions
9.4 Combinatorial functions
9.5 Formalising the problem
9.6 Brute force solution
9.7 Performance testing
9.8 Combining generation and evaluation
9.9 Exploiting algebraic properties
9.10 Chapter remarks
9.11 Exercises

Part II Going Further


10 Interactive programming
10.1 The problem
10.2 The solution
10.3 Basic actions
10.4 Sequencing
10.5 Derived primitives
10.6 Hangman
10.7 Nim
10.8 Life
10.9 Chapter remarks
10.10 Exercises

11 Unbeatable tic-tac-toe
11.1 Introduction
11.2 Basic declarations
11.3 Grid utilities
11.4 Displaying a grid
11.5 Making a move
11.6 Reading a number
11.7 Human vs human
11.8 Game trees
11.9 Pruning the tree
11.10 Minimax algorithm
11.11 Human vs computer
11.12 Chapter remarks
11.13 Exercises

12 Monads and more


12.1 Functors
12.2 Applicatives
12.3 Monads
12.4 Chapter remarks
12.5 Exercises

13 Monadic parsing
13.1 What is a parser?
13.2 Parsers as functions
13.3 Basic definitions
13.4 Sequencing parsers
13.5 Making choices
13.6 Derived primitives
13.7 Handling spacing
13.8 Arithmetic expressions
13.9 Calculator
13.10 Chapter remarks
13.11 Exercises

14 Foldables and friends


14.1 Monoids
14.2 Foldables
14.3 Traversables
14.4 Chapter remarks
14.5 Exercises

15 Lazy evaluation
15.1 Introduction
15.2 Evaluation strategies
15.3 Termination
15.4 Number of reductions
15.5 Infinite structures
15.6 Modular programming
15.7 Strict application
15.8 Chapter remarks
15.9 Exercises

16 Reasoning about programs


16.1 Equational reasoning
16.2 Reasoning about Haskell
16.3 Simple examples
16.4 Induction on numbers
16.5 Induction on lists
16.6 Making append vanish
16.7 Compiler correctness
16.8 Chapter remarks
16.9 Exercises

17 Calculating compilers
17.1 Introduction
17.2 Syntax and semantics
17.3 Adding a stack
17.4 Adding a continuation
17.5 Defunctionalising
17.6 Combining the steps
17.7 Chapter remarks
17.8 Exercises

Appendix A Selected solutions


A.1 Introduction
A.2 First steps
A.3 Types and classes
A.4 Defining functions
A.5 List comprehensions
A.6 Recursive functions
A.7 Higher-order functions
A.8 Declaring types and classes
A.9 The countdown problem
A.10 Interactive programming
A.11 Unbeatable tic-tac-toe
A.12 Monads and more
A.13 Monadic parsing
A.14 Foldables and friends
A.15 Lazy evaluation
A.16 Reasoning about programs
A.17 Calculating compilers

Appendix B Standard prelude


B.1 Basic classes
B.2 Booleans
B.3 Characters
B.4 Strings
B.5 Numbers
B.6 Tuples
B.7 Maybe
B.8 Lists
B.9 Functions
B.10 Input/output
B.11 Functors
B.12 Applicatives
B.13 Monads
B.14 Alternatives
B.15 MonadPlus
B.16 Monoids
B.17 Foldables
B.18 Traversables

Bibliography
Index
Foreword

It is nearly a century ago that Alonzo Church introduced the lambda


calculus, and over half a century ago that John McCarthy introduced
Lisp, the world’s second oldest programming language and the first
functional language based on the lambda calculus. By now, every
major programming language including JavaScript, C++, Swift,
Python, PHP, Visual Basic, Java, ... has support for lambda
expressions or anonymous higher-order functions.
As with any idea that becomes mainstream, inevitably the
underlying foundations and principles get watered down or
forgotten. Lisp allowed mutation, yet today many confuse functions
as first-class citizens with immutability. At the same time, other
effects such as exceptions, reflection, communication with the
outside world, and concurrency go unmentioned. Adding recursion in
the form of feedback-loops to pure combinational circuits lets us
implement mutable state via flip-flops. Similarly, using one effect
such as concurrency or input/output we can simulate other effects
such as mutability. John Hughes famously stated in his classic paper
Why Functional Programming Matters that we cannot make a
language more powerful by eliminating features. To that, we add
that often we cannot even make a language less powerful by
removing features. In this book, Graham demonstrates convincingly
that the true value of functional programming lies in leveraging first-
class functions to achieve compositionality and equational reasoning.
Or in Graham’s own words, “functional programming can be viewed
as a style of programming in which the basic method of computation
is the application of functions to arguments”. These functions do not
necessarily have to be pure or statically typed in order to realise the
simplicity, elegance, and conciseness of expression that we get from
the functional style.
While you can code like a functional hacker in a plethora of
languages, a semantically pure and lazy, and syntactically lean and
terse language such as Haskell is still the best way to learn how to
think like a fundamentalist. Based upon decades of teaching
experience, and backed by an impressive stream of research papers,
in this book Graham gently guides us through the whole gambit of
key functional programming concepts such as higher-order
functions, recursion, list comprehensions, algebraic datatypes and
pattern matching. The book does not shy away from more advanced
concepts. If you are still confused by the n-th blog post that
attempts to explain monads, you are in the right place. Gently
starting with the IO monad, Graham progresses from functors to
applicatives using many concrete examples. By the time he arrives at
monads, every reader will feel that they themselves could have
come up with the concept of a monad as a generic pattern for
composing functions with effects. The chapter on monadic parsers
brings everything together in a compelling use-case of parsing
arithmetic expressions in the implementation of a simple calculator.
This new edition not only adds many more concrete examples of
concepts introduced throughout the book, it also introduces the
novel Haskell concepts of foldable and traversable types. Readers
familiar with object-oriented languages routinely use iterables and
visitors to enumerate over all values in a container, or respectively to
traverse complex data structures. Haskell’s higher-kinded type
classes allow for a very concise and abstract treatment of these
concepts by means of the Foldable and Traversable classes. Last but
not least, the final chapters of the book give an in-depth overview of
lazy evaluation and equational reasoning to prove and derive
programs. The capstone chapter on calculating compilers especially
appeals to me because it touches a topic that has had my keen
interest for many decades, ever since my own PhD thesis on the
same topic.
While there are plenty of alternative textbooks on Haskell in
particular and functional programming in general, Graham’s book is
unique amongst all of these in that it uses Haskell simply as a tool
for thought, and never attempts to sell Haskell or functional
programming as a silver bullet that magically solves all programming
problems. It focuses on elegant and concise expression of intent and
thus makes a strong case of how pure and lazy functional
programming is an intelligible medium for efficiently reasoning about
algorithms at a high level of abstraction. The skills you acquire by
studying this book will make you a much better programmer no
matter what language you use to actually program in. In the past
decade, using the first edition of this book I have taught many tens
of thousands of students how to juggle with code. With this new
edition, I am looking forward to extending this streak for at least
another 10 years.
Erik Meijer
Preface

What is this book?


Haskell is a purely functional language that allows programmers to
rapidly develop software that is clear, concise and correct. The book
is aimed at a broad spectrum of readers who are interested in
learning the language, including professional programmers,
university students and high-school students. However, no
programming experience is required or assumed, and all concepts
are explained from first principles with the aid of carefully chosen
examples and exercises. Most of the material in the book should be
accessible to anyone over the age of around sixteen with a
reasonable aptitude for scientific ideas.

How is it structured?
The book is divided into two parts. Part I introduces the basic
concepts of pure programming in Haskell and is structured around
the core features of the language, such as types, functions, list
comprehensions, recursion and higher-order functions. Part II covers
impure programming and a range of more advanced topics, such as
monads, parsing, foldable types, lazy evaluation and reasoning
about programs. The book contains many extended programming
examples, and each chapter includes suggestions for further reading
and a series of exercises. The appendices provide solutions to
selected exercises, and a summary of some of the most commonly
used definitions from the Haskell standard prelude.

What is its approach?


The book aims to teach the key concepts of Haskell in a clean and
simple manner. As this is a textbook rather than a reference manual
we do not attempt to cover all aspects of the language and its
libraries, and we sometimes choose to define functions from first
principles rather than using library functions. As the book progresses
the level of generality that is used is gradually increased. For
example, in the beginning most of the functions that are used are
specialised to simple types, and later on we see how many functions
can be generalised to larger classes of types by exploiting particular
features of Haskell.

How should it be read?


The basic material in part I can potentially be worked through fairly
quickly, particularly for those with some prior programming
experience, but additional time and effort may be required to absorb
some of material in part II. Readers are recommended to work
through all the material in part I, and then select appropriate
material from part II depending on their own interests. It is vital to
write Haskell code for yourself as you go along, as you can’t learn to
program just by reading. Try out the examples from each chapter as
you proceed, and solve the exercises for each chapter before
checking the solutions.

What’s new in this edition?


The book is an extensively revised and expanded version of the first
edition. It has been extended with new chapters that cover more
advanced aspects of Haskell, new examples and exercises to further
reinforce the concepts being introduced, and solutions to selected
exercises. The remaining material has been completely reworked in
response to changes in the language and feedback from readers.
The new edition uses the Glasgow Haskell Compiler (GHC), and is
fully compatible with the latest version of the language, including
recent changes concerning applicative, monadic, foldable and
traversable types.

How can it be used for teaching?


An introductory course might cover all of part I and a few selected
topics from part II; my first-year course covers chapters 1–9, 10 and
15. An advanced course might start with a refresher of part I, and
cover a selection of more advanced topics from part II; my second-
year course focuses on chapters 12 and 16, and is taught
interactively on the board. The website for the book provides a
range of supporting materials, including PowerPoint slides and
Haskell code for the extended examples. Instructors can obtain a
large collection of exams and solutions based on material in the
book from [email protected].

Acknowledgements
I am grateful to the University of Nottingham for providing a
sabbatical to produce this new edition; Thorsten Altenkirch, Venanzio
Capretta, Henrik Nilsson and other members of the FP lab for our
many enjoyable discussions; Iván Pérez Domínguez for useful
comments on a number of chapters; the students and tutors on all
of my Haskell courses for their feedback; Clare Dennison, David
Tranah and Abigail Walkington at CUP for their editorial work; the
GHC team for producing such a great compiler; and finally, Catherine
and Ian Hutton for getting me started in computing all those years
ago.
Many thanks also to Ki Yung Ahn, Bob Davison, Philip Hölzenspies
and Neil Mitchell for providing detailed comments on the first
edition, and to the following for pointing our errors and typos: Paul
Brown, Sergio Queiroz de Medeiros, David Duke, Robert Fabian, Ben
Fleis, Robert Furber, Andrew Kish, Tomoyas Kobayashi, Florian
Larysch, Carlos Oroz, Douglas Philips, Bruce Turner, Gregor Ulm,
Marco Valtorta and Kazu Yamamoto. All of these comments have
been taken into account when preparing the new edition.
Graham Hutton
Part I

Basic Concepts
1
Introduction

In this chapter we set the stage for the rest of the book. We start by
reviewing the notion of a function, then introduce the concept of
functional programming, summarise the main features of Haskell and
its historical background, and conclude with three small examples
that give a taste of Haskell.

1.1 Functions
In Haskell, a function is a mapping that takes one or more
arguments and produces a single result, and is defined using an
equation that gives a name for the function, a name for each of its
arguments, and a body that specifies how the result can be
calculated in terms of the arguments.
For example, a function double that takes a number x as its
argument, and produces the result x + x, can be defined by the
following equation:
double x = x + x

When a function is applied to actual arguments, the result is


obtained by substituting these arguments into the body of the
function in place of the argument names. This process may
immediately produce a result that cannot be further simplified, such
as a number. More commonly, however, the result will be an
expression containing other function applications, which must then
be processed in the same way to produce the final result.
For example, the result of the application double 3 of the function
double to the number 3 can be determined by the following
calculation, in which each step is explained by a short comment in
curly parentheses:
double 3
= { applying double }
3 + 3
= { applying + }
6

Similarly, the result of the nested application double (double 2) in


which the function double is applied twice can be calculated as
follows:
double (double 2)
= { applying the inner double }
double (2 + 2)
= { applying + }
double 4
= { applying double }
4 + 4
= { applying + }
8

Alternatively, the same result can also be calculated by starting with


the outer application of the function double rather than the inner:
double (double 2)
= { applying the outer double }
double 2 + double 2
= { applying the first double }
(2 + 2) + double 2
= { applying the first + }
4 + double 2
= { applying double }
4 + (2 + 2)
= { applying the second + }
4 + 4
= { applying + }
8

However, this approach requires two more steps than our original
version, because the expression double 2 is duplicated in the first
step and hence simplified twice. In general, the order in which
functions are applied in a calculation does not affect the value of the
final result, but it may affect the number of steps required, and
whether the calculation process terminates. These issues are
explored in more detail when we consider how expressions are
evaluated in chapter 15.

1.2 Functional programming


What is functional programming? Opinions differ, and it is difficult to
give a precise definition. Generally speaking, however, functional
programming can be viewed as a style of programming in which the
basic method of computation is the application of functions to
arguments. In turn, a functional programming language is one that
supports and encourages the functional style.
To illustrate these ideas, let us consider the task of computing the
sum of the integers (whole numbers) between one and some larger
number n. In many current programming languages, this would
normally be achieved using two integer variables whose values can
be changed over time by means of the assignment operator =, with
one such variable used to accumulate the total, and the other used
to count from 1 to n. For example, in Java the following program
computes the required sum using this approach:
int total = 0;
for (int count = 1; count <= n; count++)
total = total + count;

That is, we first initialise an integer variable total to zero, and then
enter a loop that ranges an integer variable count from 1 to n,
adding the current value of the counter to the total each time round
the loop.
In the above program, the basic method of computation is
changing stored values, in the sense that executing the program
results in a sequence of assignments. For example, the case of n = 5
gives the following sequence, in which the final value assigned to
the variable total is the required sum:
total = 0;
count = 1;
total = 1;
count = 2;
total = 3;
count = 3;
total = 6;
count = 4;
total = 10;
count = 5;
total = 15;

In general, programming languages such as Java in which the basic


method of computation is changing stored values are called
imperative languages, because programs in such languages are
constructed from imperative instructions that specify precisely how
the computation should proceed.
Now let us consider computing the sum of the numbers between
one and n using Haskell. This would normally be achieved using two
library functions, one called [..] that is used to produce the list of
numbers between 1 and n, and the other called sum that is used to
produce the sum of this list:
sum [1..n]

In this program, the basic method of computation is applying


functions to arguments, in the sense that executing the program
results in a sequence of applications. For example, the case of n = 5
gives the following sequence, in which the final value in the
sequence is the required sum:
sum [1..5]
= { applying [..] }
sum [1,2,3,4,5]
= { applying sum }
1 + 2 + 3 + 4 + 5
= { applying + }
15

Most imperative languages provide some form of support for


programming with functions, so the Haskell program sum [1..n]
could be translated into such languages. However, many imperative
languages do not encourage programming in the functional style.
For example, many such languages discourage or prohibit functions
from being stored in data structures such as lists, from constructing
intermediate structures such as the list of numbers in the above
example, from taking functions as arguments or producing functions
as results, or from being defined in terms of themselves. In contrast,
Haskell imposes no such restrictions on how functions can be used,
and provides a range of features to make programming with
functions both simple and powerful.

1.3 Features of Haskell


For reference, the main features of Haskell are listed below, along
with particular chapters of this book that give further details.
Concise programs (chapters 2 and chapters 4)
Due to the high-level nature of the functional style,
programs written in Haskell are often much more concise
than programs written in other languages, as illustrated by
the example in the previous section. Moreover, the syntax
of Haskell has been designed with concise programs in
mind, in particular by having few keywords, and by
allowing indentation to be used to indicate the structure of
programs. Although it is difficult to make an objective
comparison, Haskell programs are often between two and
ten times shorter than programs written in other
languages.
Powerful type system (chapters 3 and chapters 8)
Most modern programming languages include some form
of type system to detect incompatibility errors, such as
erroneously attempting to add a number and a character.
Haskell has a type system that usually requires little type
information from the programmer, but allows a large class
of incompatibility errors in programs to be automatically
detected prior to their execution, using a sophisticated
process called type inference. The Haskell type system is
also more powerful than most languages, supporting very
general forms of polymorphism and overloading, and
providing a wide range of special purpose features
concerning types.
List comprehensions (chapter 5)
One of the most common ways to structure and
manipulate data in computing is using lists of values. To
this end, Haskell provides lists as a basic concept in the
language, together with a simple but powerful
comprehension notation that constructs new lists by
selecting and filtering elements from one or more existing
lists. Using the comprehension notation allows many
common functions on lists to be defined in a clear and
concise manner, without the need for explicit recursion.
Recursive functions (chapter 6)
Most programs involve some form of looping. In Haskell,
the basic mechanism by which looping is achieved is
through recursive functions that are defined in terms of
themselves. It can take some time to get used to
recursion, particularly for those with experience of
programming in other styles. But as we shall see, many
computations have a simple and natural definition in terms
of recursive functions, especially when pattern matching
and guards are used to separate different cases into
different equations.
Higher-order functions (chapter 7)
Haskell is a higher-order functional language, which means
that functions can freely take functions as arguments and
produce functions as results. Using higher-order functions
allows common programming patterns, such as composing
two functions, to be defined as functions within the
language itself. More generally, higher-order functions can
be used to define domain-specific languages within Haskell
itself, such as for list processing, interactive programming,
and parsing.
Effectful functions (chapters 10 and chapters 12)
Functions in Haskell are pure functions that take all their
inputs as arguments and produce all their outputs as
results. However, many programs require some formof side
effect that would appear to be at odds with purity, such as
reading input from the keyboard, or writing output to the
screen, while the program is running. Haskell provides a
uniform framework for programming with effects, without
compromising the purity of functions, based upon the use
of monads and applicatives.
Generic functions (chapters 12 and chapters 14)
Most languages allow functions to be defined that are
generic over a range of simple types, such as different
forms of numbers. However, the Haskell type system also
supports functions that are generic over much richer kinds
of structures. For example, the language provides a range
of library functions that can be used with any type that is
functorial, applicative, monadic, foldable, or traversable,
and moreover, allows new structures and generic functions
over them to be defined.
Lazy evaluation (chapter 15)
Haskell programs are executed using a technique called
lazy evaluation, which is based upon the idea that no
computation should be performed until its result is actually
required. As well as avoiding unnecessary computation,
lazy evaluation ensures that programs terminate whenever
possible, encourages programming in a modular style using
intermediate data structures, and even allows
programming with infinite structures.
Equational reasoning (chapters 16 and chapters 17)
Because programs in Haskell are pure functions, simple
equational reasoning techniques can be used to execute
programs, to transform programs, to prove properties of
programs, and even to calculate programs directly from
specifications of their intended behaviour. Equational
reasoning is particularly powerful when combined with the
use of induction to reason about functions that are defined
using recursion.

1.4 Historical background


Many of the features of Haskell are not new, but were first
introduced by other languages. To help place Haskell in context,
some of the key historical developments related to the language are
briefly summarised below:
In the 1930s, Alonzo Church developed the lambda calculus, a
simple but powerful mathematical theory of functions.
In the 1950s, John McCarthy developed Lisp (“LISt
Processor”), generally regarded as being the first functional
programming language. Lisp had some influences from the
Discovering Diverse Content Through
Random Scribd Documents
fellow citizen, a landed proprietor, by charging him, for instance, 30
crowns for an English trinket, originally purchased for no more than
10, as an equitable measure between labour and labour: it is the
younger son who robs the elder brother, to provide against the right
of primogeniture; or, in other words, it is no more than the
transferring of a few crowns, from a very valuable hand, that of the
consumer, to another equally precious, that of an agent of the
production: but it is of the utmost consequence for the Sovereign,
that, in a time of scarcity, insatiable men, were they even his
subjects, do not presume to ask 4000 grains of silver for a quarter of
wheat, upon pretence that in England, from whence it was imported,
they have paid for it 3440 grains, (for it is always upon such
victorious arguments that the national monopolist endeavours to
defend his extortions, in times of distress); the difference is so great
between 4000 grains of silver, and only 2200 or 2300, the common
price by which that of labour is regulated in my hypothesis, that all
the treasure shut up in the castle of St. Angelo could not prevent
half the inhabitants from starving for want of food in a time of
dearth. Luckily, however, this misfortune may be obviated by one of
the grandest operations in finance, that can possibly be conceived;
for the object is no less than to oblige the people to pay in good
earnest for their wheat in a moment of scarcity, at the rate of 4000
grains of silver per quarter, a price so far above the means of that
very people, to whom the intention is to shew some favour. This
financiering operation is founded on the following remark, obvious to
the meanest capacity, and perhaps not unworthy of being deeply
searched into by a judicious observer.
Were the wheat in England to cost only from 26 to 27s. per
quarter, the landed revenue, now called 63 millions, would, in fact,
amount to no more than 42; this cannot be controverted: in this
case every thing would be paid for in proportion, and certainly no
one could gain or lose by it: therefore if we invert the proportion, i.
e. if the quarter of wheat rise to 40s. at Rome, instead of 27s. and
the other productions of the earth and of industry rise in price in the
same proportion, as well as the labour by which they are procured,
the revenue of the Ecclesiastical State, which, in the present
supposition, would be only 10 millions sterling, would swell suddenly
up to 15 millions, without any one being a sufferer.—When the
question is, only to take a nominal share in the most dreaded effects
of the English taxes, in order to procure such an addition of wealth,
and get rid, at the same time, of all fear of scarcity, it would be very
wrong to reject the expedient.—Money, it is said, is wanted to carry
on the whole circulation at that rate;—but, in England, where, by a
single nod, they attract money from every part of the globe, do they
not make guineas with paper?—Why should they not, at Rome,
make as many paper-crowns as are necessary to facilitate a general
circulation of the products there? These products are so wisely
raised in price from 27 to 40s. that the number of grains of silver
necessary to purchase a pound of wheat, made into a loaf, being
now nearly upon an equality in Holland, in France, and at Rome, the
national trader, whose business it will be to guard against scarcity,
and the foreign merchants who will be invited to concur in
remedying the evil, will no longer be able to add to the price of
wheat, any more than a reasonable compensation for his advance,
trouble, risque, and the quality of the service rendered: a
compensation besides, on the extent of which it will be much more
difficult to impose upon the Sovereign, or any one else, at least
beyond a certain degree: to this advantage let us add that of
keeping the needy from the thoughts of destroying that wealth
which has been gleaned by former services.
In regard to the confidence necessary to favour that paper money,
with the same degree of value as that of England has obtained, I
confess that I do not hesitate to suppose, that the paper-money of a
Sovereign is never deemed contemptible, but when an opinion
prevails that he himself will despise it; and I dare say (were I to be
charged with a want of modesty) that the public is too deeply
interested in the inferences that may be drawn from my arguments,
for their consistency or absurdity not to be very soon demonstrated:
now, supposing them to be consistent, I think it would be, then,
beyond all possibility, even to imagine a circumstance wherein the
interest of a Prince could induce him to dishonour himself. This great
truth, generally acknowledged, could not long remain ineffectual.—
But this is not the matter in point.
The case in point is, to observe,
First, that, in the same manner as foreign coin is resolved into the
quantity and standard of the metals that compose it, in order to
know how much of the national coin may be given in exchange, just
so all kinds of foreign commodities are resolved into the quantity of
labour contained in them, or supposed to be so, that the quantity of
national labour, corresponding thereto, may be ascertained:
Secondly, that therefore, labour alone being the standard of value,
labour is consequently the only standard that can regulate the
exchanges between one nation and another:
Thirdly, that the national prices, or, to speak more properly, money
is, in fact, the most proper standard of labour between two
manufacturers in the same town; and that nothing but the
misconduct and unrestrained cupidity of the one, can prevent him
from selling his goods at the price by which the other clears a profit
that satisfies him; but in each country the common price of labour
being arbitrarily determined by the common price of the materials
necessary to set the labourer at work, the common price of wheat is,
in fact, the measure of the common price of labour in all nations:
Fourthly, that it is impossible a nation should be willing to barter a
greater quantity of its own labour, against a less quantity of the
labour of another; and yet it is to such a degree of absurdity, that
we must reduce the supposed advantage of the dreaded
competition:
Fifthly, that the liberty of exporting corn, even under its present
restrictions, makes, as it were, of all Europe, at this day, only one
family; that, on the whole, there is constantly as much of that
indispensable commodity as is necessary for all the family; but that a
man whose folly would be to trace out, describe, and acknowledge,
throughout every thing that concerns society in any essential point,
the stamp of an universal benevolence, determined to unite all men
together by their wants and interests if it is impossible to do it by
more disinterested motives, would not prove too inconsistent in a fit
of that folly which might induce him to suspect some marks of that
stamp, even in the bad seasons, in the storms which successively
visit all the parts of the world, make them all sensible of the
necessity of such union, and soon bring nearly upon a level, all the
different prices of that indispensable commodity, the cultivation of
which requires, almost every where, the same labour, or which, by
its quantity, always answers, upon an average, to the labour
bestowed upon it:
Sixthly and in fine, that hence results the impossibility that there
should long subsist, in the prices of any thing, a difference capable
of making any competition whatever, formidable to any man who will
not be so unjust as to wish and ask beads of gold for beads of glass,
or, in other words, to try in bartering, to obtain the labour of 150 in
exchange for that of 100 only.
Let us suppose, nevertheless, that there should exist at this day, a
nation pretending to be formidable in her competition, and who
should only be, in fact, remarkable for her folly, that is to say, a
nation so very blind, as to endeavour to keep the price of her wheat
under that of all other countries; I agree that the labour of her
artisans would be rated in consequence, and that the produce of her
industry might thus be purchased at a lower rate than that of any
other nation:—but what advantage could she derive from thence in a
competition abroad?⸺Though she should denominate at home the
sum of her exports, only one million for instance, because she would
call 100, the quantity of wheat, which elsewhere would be called
150, how could she require less for her returns than the other
countries, who, by the price of their wheat, would be compelled to
call 1,500,000 that which she herself would call 1,000,000?—Would
not this million represent, as really, the labour of 75,000 of her
workmen (their families included), as if it were by her denominated
1,500,000l.?—Besides, the place where she has carried her goods is
not the end of her voyage; and it is so much more necessary for her
to obtain in return the produce of 75,000 labourers (families
included), adequate to what she herself has given, as being obliged
to carry those returns home, where every thing sells, in the
hypothesis, 50 per cent. below the price they would fetch any where
else, she would lose in lowering the rates of her exports, all the fruit
she might expect to reap from her voyage.—This is what escapes
observation. They see nothing but money in commercial operations,
instead of observing that all the nations in Europe, neither do nor
can require, and that England herself does not preserve more of it
than the sum necessary to answer those five articles of which I have
spoken in examining her balance: I shall in the sequel bring some
proofs, in addition to those I have already given; but I think I have
said enough here, to justify me in insisting, that the competition can
be dreaded by the unjust man alone, by that man who wishes to sell
the labour of 100 workmen as if it were the labour of 150, and by
that man, not less unreasonable, who, compelled to sell his own
goods 10 per cent. dearer, should refuse to pay also 10 per cent.
dearer for the foreign goods which he would ask in exchange.—If
that principle—a principle of the strictest justice, is still unknown in
Europe; as an American, I glory that it is not so in America.
Reflexions on a Letter from
Philadelphia, inserted in the English
News-papers.
A Merchant of Philadelphia offers to his former Jamaica
correspondents, (see Morning Chronicle and London Advertiser of
June 24, 1785) to serve them, with all such articles as they may
require, at the current price of Philadelphia, only with the addition of
freight and the usual commission. In order to render his proposal
unequivocal, he mentions staves, and makes a calculation, by which
it appears that he could not land them in Jamaica for less than 12l.
19s. 1½d. currency per thousand; he then adds:
“By this calculation it appears, that staves would come
considerably higher than they used to be in Jamaica before the war:
it is true they are so, but it is owing to their being risen at
Philadelphia nearly 100 per cent. Of course, Jamaica prices must be
in proportion; for it would be unreasonable to expect goods of
Jamaica at the old prices, when those of America have advanced so
considerably.”
I shall venture upon some remarks on the foregoing proposition.
First, The Philadelphian has sense enough to feel, that the war
must advance the price of goods from the Colonies, in a due
proportion to the general increase in prices of all that is carried
there. In Europe, on the contrary, people are not only strangers to
the idea of that universal chain, but they are so convinced, or rather
so persuaded, that the Colonies were created, and do actually exist,
for the sole pleasure and interest of their respective metropolises,
that no imaginable means are spared to lessen the price of their
products in the mother country who receives them, in order that this
tender mother may sell them at a cheaper rate in the foreign
markets; but, ye mother countries! your colonists are also your
children, foreigners are only your brethren.—It must be owned,
however, that the coffee, indigo, and cottons, of Jamaica, Grenada,
Guadaloupe, St. Domingo, &c. are no more the territorial
commodities of England, and of France, than the corn and other
productions of those two kingdoms; and that the arguments
adduced in regard to the colonies, are, as Montaigne says, of a piece
with that by which they prove, that, the cheaper the corn, the more
brilliant is the commercial competition.—Were not Nature by her
underhand work constantly fighting, with some advantage, against
the dreams of speculators, to what pitch of misery would not
agriculture be reduced in all parts of the world!
Secondly, War has been productive, in the United States of
America, of the same effects which attend it every where else, viz.
an augmentation in the price of every thing.
Thirdly, The increase of nearly cent. per cent. assigned to the
staves, does not determine the general advance of American goods;
the excessive, but instantaneous price of one article only, denotes an
extraordinary demand for that object, and the actual impossibility of
answering that demand; the level, so necessary in all prices,
naturally returns as soon as the medium of the demand is known,
and has determined the number of hands necessary to supply it:
now it cannot be doubted, but that the goods in America must have
advanced in price, much more than any where else, because the
expences of the Colonies have been, during the war, relatively
speaking, much more considerable than any where else, considering
the discredit inseparable from the precariousness of their situation.
But the difference between their inland common prices, and those of
Europe, was so great (this will presently be seen), that they may
increase them enough to pay off the interest of their national debt,
and yet keep the European prices at a distance.
Fourthly, The United States are now a foreign nation in regard to
Jamaica, which belongs to England; yet this consideration does not
render them so far unjust, as to shake off the burden of their taxes,
and fix it on the inhabitants of Jamaica; they only make them
nominal partners in that burden, (if the expression may be allowed),
without any inconvenience arising therefrom to either of the parties.
Fifthly, They have the true notion of an equitable trade, founded
on the continuation of former relations between goods and goods; a
principle from which I only draw inferences relative to the national
debt, and which suffices to destroy all the hideousness of that
phantom.
Sixthly, They do not pretend, with the Europeans, that the
increase in the national prices, can in any thing affect their
exportation; but they have found, that being obliged to sell dearer, it
was their duty to offer very frankly to pay also dearer for whatever
they wanted in return.
Seventhly, They do not entertain the least doubt on what seems to
be unknown in Europe, namely, that the real benefit of a voyage can
be found only in the price which the returns will meet with, when
arrived in the country where the voyage is to terminate.
Eighthly, In the union, and in the execution of these different
points, centers the little mystery, by means of which Nature has
hitherto filled up by slow degrees, and by which the American
proposes, without thinking so to do, to fill up with more dispatch,
those little furrows of taxes, the very name of which is now a
bugbear, but would cease to be so, if the manner in which they are
planned, imposed, and above all, collected, did not prolong and
increase the real and momentary evil, which will ever be inseparable
from them.
Ninthly, It is singular enough, that the European cultivator should
be taught by the American trader, the necessity and the justice of an
increase of price in the productions of the earth, proportionable,
says the honest Philadelphian, to that which is to be met with in the
price of the productions of industry:—It would be unreasonable, says
he, to expect the goods of Jamaica at the old prices, when those of
Philadelphia have advanced so considerably.—Nay, say the European
manufacturers, since our goods, by means of the taxes, have
increased 10 per cent. it follows necessarily that the price of wheat,
sugar, indigo, &c. should fall in the same proportion, in order that
the trade in competition may be supported abroad;—had not Nature,
by her underhand work, constantly fought with some advantage
against the dreams of speculators, and against the much more
dreadful surreptions of cupidity, to what pitch of misery would not
agriculture be reduced in all parts of the world!
The following estimates may be of some service; their utility is
independent of the absolute precision of the facts on which they are
founded; one may, as occasion requires, extend or contract the
compasses.
Previous to the last war the common price of wheat was, upon an
average, in America about 20s. sterling per quarter, (vide Mr. A.
Young’s Political Arithmetic).
If in England a population of 9,000,000 of industrious inhabitants,
yields a landed revenue of 60,000,000l. sterling, the wheat being
there at 40s. per quarter, a population of 3,000,000 of industrious
inhabitants in America, where wheat sells at 20s. a quarter, ought to
produce at least a landed revenue of 10,000,000l. sterling; I say at
least, first, because the land is new, and produces as much, with
less culture; and secondly, because that part of the inhabitants
employed in agriculture in England, constitute only one third of the
whole population, and that in all probability, above two thirds of the
Americans are employed in works of husbandry. It may therefore be
presumed, that their landed revenue exceeds 20,000,000, instead of
the 10 which I have set down; but this surplus of 10,000,000, only
serves to make good both the national and foreign industry, which is
to balance it, and pay off the taxes: so that, in whatever light my
thesis be considered, every error turns to their advantage.
In limiting their landed revenue to 10,000,000, their wheat
remaining at 20s. per quarter; let everyone judge what load of taxes
they could bear, before the price of their wheat and other territorial
productions, should come up to that of the same commodities of
Europe, even including the expences for the export of their
surplusage.
Let every one judge also of the necessity of their bankruptcy, the
idea of which has been so fondly cherished by some low-minded
people, and the narrative of which, they feared perhaps themselves,
would unavoidably stain the first pages of the history of their
political existence.
The last war, it is said, has loaded them with an interest of
1,000,000 per annum. Would a tax of 10 per cent. on every article,
or rather on the total of the produce of national, as well as foreign
industry, consumed within the country, be productive of any other
effect, but that of increasing the prices nearly as much? and would
the cultivators of wheat and other productions of the earth, have
occasion for any other expedient to pay the tax, without being at
any expence, without any one being aggrieved, (provided they
should raise in the same proportion the price of labour attending
cultivation) but that of advancing, in the mean time, the price of
their wheat, and other productions of the earth, from 10 to 11 or 12,
from 20 to 22 or 24?—This is the case in my first hypothesis, with
this difference, that the 21,000,000 interest, mentioned therein,
represented highways, havens, canals, public schools, &c. and that
the interest of 1,000,000, in the United States, will represent the
establishment of their independence. Such a monument is, in my
opinion, too precious to admit a thought of destroying it by a
reimbursement,—a reimbursement palpably useless so soon as the
price of every thing is restored to a level with the interest of any
national loan whatever.
They have committed some errors; more will follow: they know
not what to fix upon; nor will they know for some time, perhaps for
a long time.—Is there a State in Europe that can reproach them with
any false step, of which that very same State did not set the
precedent at some period of its history?⸺But with their principle
concerning exportation, a principle founded on justice and evidence,
they have already perceived that the necessitated price of 22 or 24,
instead of 20, must be felt in their country alone; and if their
commodities exported for the purpose of procuring such articles for
their home consumption, as they stand in need of, continue still to
yield them the same quantity of those articles of consumption, as
were obtained before the war, will they not perceive that the home
prices, which the re-action of the taxes shall have set upon the
whole of their productions, establish in the country an exact balance
of those new prices at which the taxes will oblige them to sell the
articles to be imported?
Compelled by necessity to have recourse to paper-money, will it
be long before they are made sensible, that nothing more than
internal credit is wanted to make this paper equal to coin, and
answer all its purposes for ever, if they should be thus wisely
inclined,—if this measure should be found the only means of curbing
effectually the cupidity of those with whom they shall have occasion
to trade?
Will it be long before they perceive, that this credit will follow
close upon the solidity of public engagements,—a solidity
demonstrated by the evidence of the inutility of a base and infamous
robbery?
Will it be long before they feel that all the actual wealth of a State,
its real wealth, is nothing more or less than the mass of its present
industry; that all its possible wealth can arise only from the sum of
all its possible labour; that the greatest riches are only the greatest
sum of labour? that if this labour is a bitter pill, the gold and silver in
which it is wrapped up, are only (like honours, titles, dignities, fame,
esteem, &c.) different kinds of powders, which sweeten the taste of
it to those who are ignorant of its value, to those who know not how
necessary labour is to support every day, without being weary, and
sometimes without regret, the wretched burthen of our lives; and in
fine, that paper, once got into credit, can, in this respect, be an
ample substitute for gold and silver ... but how many circumstances,
where gold and silver cannot supply the want of credit?
Will it be long before they become sensible, that they are clogged
in no part of their legislation, by those preposterous maxims which
can be justified only by the circumstances that gave them birth, by
those tyrannical regulations which owed their success wholely to the
ignorance of their cotemporaries, by that chaos of contradictory
regulations, all of which became perhaps necessary by degrees,
after the first was extorted by cupidity?[6]
Under what Point of View Premiums
and other Encouragements of
Exportation may be considered.
The principles of the Americans concerning exportation, lead us to
the examination of the doctrine of premiums.
If the want of objects, capable of exercising advantageously the
industry of a numerous and active people, should compel
government, on account of some difficulties unconquerable by art
and nature, to apply that industry to some other object, on which it
would be impossible to support abroad the competition of another
nation, that is, to offer equally with the latter an even quantity of
labour of one sort, for an even quantity of labour of a different one,
there is no doubt but, in such a case, a certain premium, to maintain
the competition with the country most partially favoured by art and
nature, would prove, of all institutions, the most judicious and the
most humane; it would be a kind of indirect tax in favour of
laborious indigence; a tax, much more eligible than many others,
which, though destined to the relief of wretchedness, often increase
it, by checking the efforts of industry, by even providing a resource
for idleness, and sometimes an alluring, a comfortable prospect for
debauchery.
It was represented to a Prince truly worthy of the throne he fills,
that a manufactory, in which 8 or 900 persons were constantly
employed, stood him in 4 or 5,000 crowns more than it produced.
How! (replied the Sovereign) does it cost me no more than 4 or
5,000 crowns to feed a thousand beggars, and keep them constantly
at work? It is a cheap bargain indeed! The most subtle of all
ministers of state could make no other reply to such an answer, than
to propose some means, equally effectual, and calculated to attain,
at a cheaper rate, the two most important ends that a prince can
have in view, destroying beggary, and, in a manner, creating labour.
There are, no doubt, some other circumstances, which may also
justify premiums on exportation; for instance, the wheat intended
for exportation, is an indispensable article amongst the necessaries
of life: it constitutes one third, sometimes the half of a nation’s
riches; it is essential that it be not in such quantity as to fall in price,
because the disparagement of its value would discourage the
cultivator; yet it is advantageous that there should be, upon a
medium, a little more than is wanted, in order to keep it at the
medium price it ought to fetch, that one may have it in his power to
purchase that which another wants to sell. The first thing therefore
to be examined is, whether the medium price, at which it must be
kept, in order to equipoise the quantity of national industry which it
must represent, be not so considerable,
First, By reason of some prohibitory act, forbidding the exportation
of other productions of the earth, which, by this means, become
cheaper than they were before this act took place, oblige the
cultivator to advance his price in the others, that the whole may be
raised to the level of industry:
Secondly, By reason of some other premiums on exportation,
granted to various branches of the national industry, which, on that
very account, are grown not only much dearer within the nation, but
have also enhanced the price of all other corresponding
commodities, by withdrawing from them, hands which would have
increased their quantity:
Thirdly, In consequence of some prohibitions or restrictions
equivalent thereto, which afford to the national manufacturer the
means of selling his goods 10 per cent. dearer than he could do, if
such reasonable duties were laid upon foreign industry, as would
leave national industry in possession of the advantages, which she
has a right to, and deprive her only of the iniquitous privilege of
ransoming those by whom she is fostered:
Fourthly, By the effect of those bodies corporate, (corporations)
which, if justly appreciated, are but so many private conspiracies
against the public, whom they strip of the benefit of national
competition, after having wrested from them the advantages of
foreign competition, which would soon have been followed by the
former, infinitely more important than the other.
If the result of the proposed enquiry should show, that one of
these four causes, or rather all of them together, have entirely
perverted the natural price of every article in the nation, it seems to
me that it would be worth the attention of the legislature to examine
also, whether the repeal of all premiums, prohibitions, restrictions,
and other devices of the various passions of the human heart, either
to clash against each other, or to balance their respective injustice,
would not prove adequate to the only aim which we may reasonably
wish to attain, I mean that of keeping, at the least expence, a just
equilibrium between national agriculture and industry, by securing to
both, at the least expence, all the advantages which they have a
right to expect from the agriculture and industry of other nations.
But if indeed we were fettered by the errors of past centuries, it
would then be necessary to grant, in the fullest extent, the wished-
for premium on the most important article; do nothing more for the
present, but refuse new ones to all the rest; watch attentively the
favourable minute for the restoration of natural order, and forward it,
perhaps, by convincing every one, that the most necessary of all
premiums would have proved useless, had it not been preceded by
prohibitions, restrictions, corporations, &c. the end of which is as
manifestly unjust, as their effects are injurious to all but those who
sue for them; and that, in fine, a premium granted under a
circumstance the most likely to justify such a measure, is not, as
several people have hitherto imagined, a necessary means of
maintaining elsewhere a foreign competition, but a very inadequate
compensation for that foreign competition of which we are deprived
in so many respects.
On the Influence of the various
Kinds of Taxation upon National
Prices.
If I mistake not, I have proved that it is indifferent to agriculture
and industry, whether the prices rise or fall, provided it be always in
a due and reciprocal proportion. Nor is it less indifferent, whether
the increase proceeds from taxes, from monopoly, or from accession
of wealth, and whether the decrease be brought about by the
extirpation of monopoly, or by the triumph of smuggling; so long as
the prices balance each other, no one can be injured however loud
people may be in their clamours; it is impossible to shut one’s eyes
against the evidence of such a point. Why then should we deny the
consequence which naturally follows, of the harmlessness of taxes in
themselves, the impossibility of their producing in any one’s
situation, any thing beyond a momentary sensation, when they are
laid with discernment; and the futility of either fears or hopes
entertained of their ending at last in a national bankruptcy?
Yet, “to enjoy, is to obey,” says Pope:—To make the best use we
can of the creation, is the thanksgiving the most worthy of the
Creator.—There is not a man therefore who ought not to repine at
seeing the general rate of prices increase in vain, since this very rise
compels us to lavish, in coin, a considerable quantity of those two
precious metals, gold and silver, which would prove more agreeable,
if turned into plate, or even into small pocket-statues, designed for
the private worship of those who would blush only in public, for this
kind of idolatry. I should like therefore to examine, in regard to
prices, what is natural, what necessary, and what forced; in order to
find out what might be saved, if people would attend only to the
necessary average.
In the first period of Societies, when they knew of no other want
in the State but personal service when it was necessary and
possible, the common price of the articles then in circulation, was
determined by the quantity of coin then existing in the nation: this is
what may be justly termed the natural price. At this present time,
when money is substituted to personal service, and supplies so
advantageously its place; when each representation of an extra
service leaves on every article, the stamp of a seal, which, without
adding to the real or relative value of any thing, increases
nevertheless the nominal value of every thing;—at this present time,
when every nation has all the industry necessary to procure the coin
wanted for this over-charge, it is the price, which this very over-
charge sets upon the different objects, that regulates and attracts
the quantity of silver to correspond therewith; and this price, which
may be called necessary, is often evidently forced: I say, evidently,
because, in the state of general correspondence, or, if you will, of
that happy dependence wherein all the States of Europe stand
reciprocally towards each other at this hour, when we see in one
country the same objects, of the same quality, wrought with equal
skill, 15 per cent. dearer than any where else, who can doubt but a
part of that difference, of that extraordinary price, proceeds from
taxes, and the other from monopoly? But what part belongs to this,
what part to the other? This is not so easily found out; 1st, because
the part which is the work of monopoly, solely depends on the
moderation of the monopolist, who never fails pleading the taxes for
excuse; and, 2dly, because that part, which proceeds from the taxes,
depends not only on the tax itself, but also on the manner of laying
it, and on the effect which it is likely to produce in the minds of the
people who are to support it. Such a tax as will make a slow, and
only a trifling sensation in the prices of the French markets, will
occasion all at once a considerable one in those of England: I shall
hereafter state my reasons for this conjecture.
I am as little qualified to investigate all these different questions,
as those which I have ventured hitherto to touch upon; I shall
persevere, nevertheless, with that freedom which I derive from the
purity of my intentions, and with that diffidence which must follow
the consciousness of a capacity so unequal to the task.—I shall first
of all adapt to England, and then to France, the reflexions suggested
to me by some hundreds of suppositions, which had engrossed my
time before I had perused Young’s Political Arithmetic, and the work
of Mr. Necker, which has but lately fallen into my hands.
I shall begin with a general observation on taxes.
On the Object of all Ministers of
Finance in laying Taxes.
In this indulgent age, wherein nothing more is required on any
one subject, than a little decency, it would be a ridiculous and
fruitless hypocrisy to propose a tax, as the means of encouraging
virtue, or of discountenancing vice; it is not, at least in a country
where a man convicted of smuggling wool, is by law sentenced to
have his hand cut off, nor in another where a smuggler of salt is
condemned for years to serve on board the gallies, that one should
preach up the heart-felt concern he must experience at framing a
law which would make it felony to drink spirituous liquors if he had
really a mind to prevent intoxication; it is hoped on the contrary,
nay, firmly believed, that the sweetness of the poison will make
palatable the very bitterness of the tax, and its absurd disproportion
to the real value of the taxed article: besides, it is too evident, that it
is not the difference of a few pence more that will prevent a man
from drinking to excess when he is so inclined, nor a few pence less
that will occasion another to inebriate himself, when his only motive
for drinking is a moderate pleasure, or the necessity of allaying his
thirst. The object of every Minister, in laying a tax, is always to
procure the sum at which he has rated its produce; if the tax should
answer any other purpose, this additional one is considered merely
with regard to the prospect it affords of making good another tax
less productive than was at first expected. In fact, a minister of
finance is not a præfectus morum—a moral censor: the State is in
want of a certain sum; that’s enough, it must be found.—Let us then
examine, what kind of taxation will be the least burdensome in its
operation, give its first shock with the least violence, and be
attended with inconveniences of the shortest duration.
Effects of a general Poll-Tax.
Eleventh Hypothesis.
In the year 1779, the taxes in England amounted, I shall say, to
10 millions; I shall suppose too, that this was the tenth part of the
general produce of the land and industry: therefore the 10th part of
the nominal value of that general produce belonged to the tax, or
was necessitated by the tax; the 40 shillings, which, to facilitate my
operations, I shall also suppose to be the average price of the
quarter of wheat, must then have been considered as the necessary
price, or the price necessitated by the tax, and 36s. as the natural
price, or the price acquired by the sole, natural increase of the
national wealth. But in order that those 36s. might be called the
natural price, the taxes should have been divided in such a manner
as to load each particular article with a 9th part of its value; that is
to say, that each individual, possessed of a property denominated 9,
should see it charged only with one ninth more, in consequence of a
general poll-tax, which we shall suppose to have been assessed with
the utmost impartiality. In effect, it appears, that in this case the
proprietor of a quarter of wheat, who, in consequence of the tax,
would have raised the wheat from 36 to 40s. could not be said to
have injured the hatter, who would sell him for 40 guineas the 40
hats which, previously to the poll-tax, he used to let him have for 36
guineas. It also appears, that the hatter could not be injured by
giving 10 to the workman, instead of the 9 which he had hitherto
paid; and that, in fine, if 27 millions had proved sufficient for
circulation formerly, three millions more, once found, were fully
adequate to the annual and perpetual payment of those 10 millions
of taxes, without any one being a sufferer, but at the instant of the
first payment. This system is deficient only in point of practicability;
it is not established in England: 36 shillings therefore are not the
natural price of wheat; the wheat certainly owes above 4 shillings to
the taxes, if its current price amounts to 40s.
Let it be observed, nevertheless, that if the system of a poll-tax
could be reduced to practice, if it were not of all systems the most
absurd, though the easiest for government, if it were not of all
systems that in which it is most evidently impossible to avoid
thousands of injuries to the subject, one might establish now in
England a new tax of 10 millions annually, and pay it for ever,
without altering in the least the condition of anybody, provided one
could find previously, and once for all, 2,600,000l. and that wheat
should advance in price from 40s. to 43s. 4d. and every thing else in
proportion. This appears to me so glaringly evident, that it extorts
from me the affirmative tone. Now as soon as this should be
effected, the burden of the tax would clearly be NULL.
But, it will be objected, the price of wheat is not thus arbitrarily
advanced:—certainly not; for were this to be the case, it might also
be lowered at pleasure, and would every other day, alternately rise
from 1 to 80s. and fall from 80 to 1, since for this operation (become
indispensable) it would suffice that there should be in all the
provinces of England as many bodies-corporate (corporations) in
agriculture, as there are in industry. I am even inclined to think, that
it would then be minutely examined, Whether it be in fact
advantageous to agriculture, that the merchants export more goods
than they import? (a due attention being paid to the five articles so
often mentioned, which render necessary the importation of bullion);
a question of the utmost importance, to which I do not see that any
body has hitherto attended, and which might be so easily
determined, if my principles are just.
Effects of a Land-Tax.
All taxes, it is said, fall on the land at last. Land is the true, the
only spring of wealth; wealth should be taxed at its very source.
It is certain, that merely by knowing how the matter stands, we
know how to proceed accordingly; and that, in the long-run, every
thing arranges itself in the least exceptionable manner that the
system of taxation will permit. The following is probably the course
which things would take, in the system of a land-tax, if it were
necessary now to lay on the land a new tax of 10 millions annually,
supposing always the landed revenue at 60 millions, and the quarter
of wheat at 40 shillings.

Twelfth Hypothesis.
(I must premise, that in all I have now to say, not only on the
present hypothesis, but on all those that follow, I build on this
principle; that, from the moment every individual pays the tax,
nobody pays it; that nevertheless its produce reverts to the creditors
of the State, and that therefore every body is interested in carrying
matters to that issue as soon as possible.—If there never existed in
the average of prices any revolution so sudden, so great, and
constant in its effect, as the one which I am about to suppose; it is
because it never was necessary to lay all at once 10 millions of
taxes. The effect produced by one million on a revenue like that
which England enjoys, is so trifling, so gradual, that it never can be
felt.—But to my hypothesis).
The march of industry is always firm; she can never be bewildered
by her guide. A tax of 2 shillings upon a hat will soon occasion either
an alteration in the quality, or a proportionate increase in its price[7].
Nothing more just. But agriculture has only one resource; she
cannot alter the quality of her productions, and she is always timid
when she wants to increase their prices. Let it be granted, however,
that the first attempt of the cultivator will be to enhance boldly the
price of his goods, in a proportion which may return him the amount
of the tax supposed to be of 10 millions: his wheat, of course, will
rise from 40 to 46s. 8d. and so with regard to other productions;
then his revenue, instead of 60, will be 70 millions; but, being
obliged to lay down 10 for the tax, he will have only 60 millions left.
Let us now observe, that when the operations of agriculture are
talked of in consequence of taxes, the land proprietor is alluded to;
and from him they suppose that the ten millions are taken, just as
the fleece is shorn from the sheep; but, on the other hand, that
proprietor, though not very clear in his idea of what is best for him
to do, feels mechanically that he has a right to defend his fleece,
that is, to increase the price of the productions of his land, because
without them, neither the manufacturer nor the Minister of Finance
can subsist, and to raise that price to such a level as will subject him
to pay only just as much as the minister and the manufacturer: and
this again appears to me extremely just.
Now this very proprietor receives of his 60 millions revenue, or
rather of the revenue of his land, no more than about 20 millions;
(this is nearly the result of Mr. Young’s statement: it will be seen, in
the sequel, that more or less would only alter the proportion of the
shares, without having the least influence either on the application
of the principle, or on its consequences): the 40 millions overplus is
swallowed up, viz. for the daily pay of the labourer, 20 millions, and
20 millions for the other charges with which the estates are
encumbered, tythes, profits of farmers, &c. &c. It follows, of course,
Either
That the proprietor’s share must be advanced to 30 millions, if he
alone be taxed; and this will leave each of the other parts interested
in the landed revenue, in possession of its 20 millions, as well after
as before the tax;
Or,
That each of the three parts taxed singly, at 3,333,333l. 6s. 8d.
and enabled to pay the impost by an advance of price, both in the
productions and in the wages of labour, be reduced to its primitive
20 millions, after the payment of the tax.
One is evidently equal to the other; but what is not so, is, that
industry, who paid her workmen with 20 millions when the quarter
of wheat was at 40s. cannot pay them since the wheat is increased
to 46s. 8d. but by adding to the former wages, 3,333,333l. 6s. 8d.
an advance which, when divided on the total of her products,
heretofore rated at 60 millions, raises each third part of 20 to
21,111,111, and some trifling fractions.—Now, there remains in the
hands of each of the parties concerned in agriculture, only 20
millions over and above the payment of the tax.—Those who are in
the persuasion that the discharge of the import must lessen, by its
whole amount at least, the revenue of those who pay it, think, no
doubt, that agriculture is very well off, to have, by raising the price
of its commodities two thirds, lightened the weight of so terrible a
burden; yet if it were possible by a vigorous exertion, by an
additional increase in the price of provisions, to make it null to every
body, I do not see that it would be reasonable to oppose such
exertion; for, after all,
Either
The first increase, brought on by agriculture, was unjust; the
proprietor was doomed to sustain alone the whole weight of the tax,
if we allow the taxator, the man who laid the tax, to have had a
single thought on the subject:
Or,
The further advance in the prices of agriculture is of the most
indispensable necessity, if the taxator has only thought of getting the
amount of the tax with the least trouble to himself, leaving to Nature
the care of distributing to every one complete justice,—to Nature,
who never fails to do it, and who, in so complicated an operation,
employs only the simple spring of that private cupidity, with which
she has armed and shielded every individual; just as, in order to
settle the most exact symmetry in that admirable edifice commonly
called a hive, she employs no other agent than the reciprocal
pressure of that multitude of architects who work at it, each of
whom thinks of nothing but to secure a little cell for himself.

Thirteenth Hypothesis.
Let us then suppose that agriculture, judiciously determined by
wisdom not to suffer the least encroachments on any part of her
cell, or mechanically led by cupidity to justice, boldly raises the price
of her wheat from 40 to 50s. and the rest of her products in a due
proportion; her general revenues will then be increased from 60 to
75 millions; each of the three parts interested therein will therefore
stand at 25 millions, but will be reduced to 21,666,666l. 13s. 4d.
when the tax is paid off;—
Industry, compelled also by the advanced prices of the
productions of the earth, to pay her workmen 25 instead of the 20
millions which they required in the first instance, will divide the
additional 5 millions amongst the 60 millions of her former returns;
each third share therefore, rated hitherto at 20 millions, will, by
means of the addition, rise to 21,666,666l. 13s. 4d.—which is the
exact balance of the like sum left in the hands of each of the three
branches of agriculture, after having discharged the tax.
In a system of taxation which should be imposed only on the land,
an impost of 10 millions annually, on a revenue of 60 millions,
whether it fall on the proprietor, or be divided between him, the
farmer, the cultivator, and other parties concerned, requires of
course an addition of 25 per cent. to the price of the productions of
the earth, that agriculture may not be sacrificed to industry; but it
must be observed, that immediately after the reaction of the one
upon the other shall be completed, the burden of the tax will
evidently be null, since the price of labour will have increased
equally in both, in proportion to that of their respective products.
Reflexions on the foregoing System.
This system was devised to countenance and encourage
agriculture; it is in her hands, they say, it is at that fountain-head of
riches, that riches must be sought for; it is the land that finally pays
for all; the impost then must be laid on the net produce of the land.
—I shall venture some reflexions on a subject which appears to me
the more important, as one of the wisest, and the most profound
speeches ever delivered in the House of Lords, seems to hint at the
expediency of an aggravation of the burden already laid on
agriculture.
Agriculture is the spring of life; it is not the spring of those riches
which we call money: money must be had for taxes; money flows
from the hands of industry alone: it is then from this spring that
money must be drawn.
Besides, how is it known that the money, wrested from
agriculture, is not necessary to her support? Or how does it escape
observation, that all the money which is not laid out by the cultivator
upon agriculture, will necessarily revert to industry, either by the
immediate consumption of the cultivator, or by that which he shall
have occasioned on the part of the person to whom he shall have
lent the value of what he has not consumed himself?
How comes it to be known, that the proprietor of a landed estate
that yields him, we shall suppose, 800l. per annum, and who is
charged 200l. for taxes, is not indebted in 300l. out of the remaining
600l.? Now, it is true that 300l. are sufficient for his support; but
were those 200l. which are forced from him, laid out annually on his
land, they would certainly in very few years raise its produce from
800 to 1000l.—What is that but to assess unjustly a man who enjoys
only 500l. as high as another whose income amounts to 800l.—to tie
down agriculture to 800 when it might rise to 1000; to deprive
industry of the re-action produced by that benefit; to crush
population in the very bud, and consequently to prevent a more
considerable consumption; in fine, to deprive government
beforehand of the amount of those taxes which that increase of
population and consumption would have secured to the State?
It may be said in France, it is true, that by a tax laid on private
loan-covenants, those inconveniences are partly removed; but this
very removal is only an additional obstacle, thrown in the way of
agriculture, to impede its progress;—the man who could lend to the
cultivator, besides the fear of not receiving back his money when
wanted, has before his eyes the certainty of being charged with the
twentieth penny laid on the interest of the money thus advanced,
and consequently, as often as he conveniently can, lends that money
to a merchant, who besides his punctuality in paying at the fixed
time, never hesitates to allow the usual interest without any
deduction whatever.
It may be said also in England, that all over Great Britain, the
land-tax, (which, like some others, is perhaps no more than a real
poll-tax under a name less grating to a British ear) does not exceed
the sum of about 2 millions out of 14 or 15, the whole amount of
her taxes; but nothing can be deduced therefrom, but that it is
subject only to a proportionable share of the inconveniences above
stated; inconveniences which are inseparable from it: we may add,
that it is indeed free from some further grievances which fall heavy
on the French cultivator:—but can the English boast of their tax
being founded on an invariable principle, when this very principle is
unjust in its consequences, and, as often as necessity requires the
tax to be advanced, multiplies the injustice which follows it?—Yet
they hint at the expediency of increasing that very tax, in order to
alleviate the imaginary burden that weighs down industry!—Some
pretend that the land-tax is become a public property; they suppose
that all such sales and purchases of land as have taken place since
the year 1740, have been effected on that principle of renunciation
of the capital, the interest of which is paid by that land-tax:—they
infer, no doubt, that the intention of those who did not sell, was
implicitly included in that of those who have actually sold; for they
propose that all the present proprietors shall redeem the tax, in
order to refund part of the national debt; as if, on the very next day
after the redemption, Government had not a right to renew it, if
some fresh exigency should start, which could not be answered by
any other means.
In the critical moment of a discredit, which will always be
imputable to the Minister, when the King and the People are fully
acquainted with their real interest, if administration, not knowing
what to do, does not hesitate to apply to the land proprietor, whose
ways and means are always visible, and whose purse lies, as it were,
ever open against his own inclination, the Minister, no doubt, finds
his excuse in the necessity; but after the crisis is over, why should
the proprietor be further aggrieved?
But, say they, the amount of the tax cannot be dispensed with;—
no objection can be urged against necessity; all that is wanted, is
the least that can possibly be given; just as all that is wanted, is the
most that it can be advantageous to take: but the whole should be
paid by each individual, only in proportion to his faculties:—Now the
fact is, that the faculties of the land proprietors are not better known
than those of the merchants;—the latter have found means to prove,
to persuade, that they ought not to be taxed, but in proportion to
their consumption, the only criterion of their riches, or at least that
part of their riches which they do not lay out in increasing
commercial wealth.—Is the improvement of the territorial wealth less
essential, or less valuable to the State?

Let us examine, however, in what degree the taxes laid on the


different articles of consumption, must enhance the price of goods,
in order that agriculture may not suffer more than industry. If it
should result from this research, that many previous false steps have
raised the greatest obstacles against the execution of those
measures which would prove the most equitable, without being
more disadvantageous in any point of view; the inconvenience of
such obstacles might be deemed trifling, when compared with the
burden supposed to be transmitted to posterity. And it is not in
England that an important truth, generally acknowledged, will long
remain without effect; it is not in England that an important truth
will long remain without being generally acknowledged.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like