O'Reilly logo

Thinking Functionally with Haskell by Richard Bird

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1

What is functional programming?

In a nutshell:

  • Functional programming is a method of program construction that emphasises functions and their application rather than commands and their execution.
  • Functional programming uses simple mathematical notation that allows problems to be described clearly and concisely.
  • Functional programming has a simple mathematical basis that supports equational reasoning about the properties of programs.

Our aim in this book is to illustrate these three key points, using a specific functional language called Haskell.

1.1 Functions and types

We will use the Haskell notation

f :: X -> Y

to assert that f is a function taking arguments of type X and returning results of type Y. For example,

sin:: Float -> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required