0% found this document useful (0 votes)
15 views3 pages

CH 1

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)
15 views3 pages

CH 1

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/ 3

What is a Functional Language?

PROGRAMMING IN HASKELL
Opinions differ, and it is difficult to give a precise
definition, but generally speaking:

z Functional programming is style of programming


in which the basic method of computation is the
application of functions to arguments;

Chapter 1 - Introduction z A functional language is one that supports and


encourages the functional style.
0 1

Example Example

Summing the integers 1 to 10 in Java: Summing the integers 1 to 10 in Haskell:

int total = 0; sum [1..10]


for (int i = 1; i  10; i++)
total = total + i;
The computation method is function application.

The computation method is variable assignment.

2 3

Historical Background Historical Background

1930s: 1950s:

John McCarthy develops Lisp, the first functional


Alonzo Church develops the lambda calculus,
language, with some influences from the lambda
a simple but powerful theory of functions.
calculus, but retaining variable assignments.
4 5

1
Historical Background Historical Background

1960s: 1970s:

Peter Landin develops ISWIM, the first pure John Backus develops FP, a functional
functional language, based strongly on the language that emphasizes higher-order
lambda calculus, with no assignments. functions and reasoning about programs.
6 7

Historical Background Historical Background

1970s: 1970s - 1980s:

Robin Milner and others develop ML, the first


David Turner develops a number of lazy functional
modern functional language, which introduced
languages, culminating in the Miranda system.
type inference and polymorphic types.
8 9

Historical Background Historical Background

1987: 1990s:

An international committee starts the development Phil Wadler and others develop type classes and
of Haskell, a standard lazy functional language. monads, two of the main innovations of Haskell.
10 11

2
Historical Background Historical Background

2003: 2010-date:

The committee publishes the Haskell Report, Standard distribution, library support, new
defining a stable version of the language; an language features, development tools, use in
updated version was published in 2010. industry, influence on other languages, etc.
12 13

A Taste of Haskell

f [] = []
f (x:xs) = f ys ++ [x] ++ f zs
where
ys = [a | a  xs, a  x]
zs = [b | b  xs, b > x]

? 14

You might also like