406x Filetype PDF File size 0.30 MB Source: www.cs.waikato.ac.nz
FUNCTIONAL Many of these notes are based on
PROGRAMMING AND “Haskell: The Craft of Functional
HASKELL Programming”, Simon Thompson, Addison-
Wesley, 1996
This introduction is based on chapter one of:
SOME ELEMENTARY NOTES
“Functional Programming with Miranda”,
Ian Holyer, UCL Press, 1993
Steve Reeves which is in the Library.
Department of Computer Science
University of Waikato Other good books, all in the Library, on functional
programming are:
“Miranda: The Craft of Functional
Programming”, Simon Thompson, Addison-
Wesley, 1995
“Introduction to Functional Programming”,
Richard Bird and Philip Wadler, Prentice-
Hall, 1988
“Elements of Functional Programming”,
Chris Reade, Addison-Wesley, 1989
Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 1 Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 2
Also, search the Library catalogues for “functional
programming” - there are about 12 more books on the Taxonomy
subject in our Library
specification
declarative logical
functional
languages
structured
procedural high-level
low-level
Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 3 Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 4
Procedural Languages Evolution
• developed first in the 1950s
machine code
• most languages today are procedural low-level
• two common ideas assembly
- instructions executed
sequentially
- values stored in locations high-level ForTran, BASIC
• brought together by defining sequences
of instructions to change the contents of
storage - procedures, routines
structured C, Pascal, Modula
these languages closely match the
architecture of most of today!s computers
object-oriented Smalltalk
- advantage is efficiency C++
- disadvantage is unnecessary
detail
Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 5 Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 6
Declarative Languages
• origins in the !-calculus of 1930s • Various sorts of expressions declare
relations between values
• became practical in the 1970s
• at a higher-level than any of the • Logic programming languages use
procedural languages relations
• breaks away from the procedural model
• Specification languages use any
• allows expression of algorithms in a very mathematical structures you like
clear and direct way
- they are more general and
• few unnecessary details expressive than either logic of
functional languages
• values can be defined and manipulated
directly - so expressive that you can write
down relations that are not
• no need to worry about how or where computable!!
they are stored
• algorithms are given by declaring • Functional languages use functions
relationships between values - no
concern about the order used
Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 7 Functional Programming and Haskell–Steve Reeves–2006–University of Waikato 8
no reviews yet
Please Login to review.