Book contents
- Frontmatter
- Contents
- Foreword
- Preface
- 1 Formal Study of Natural Language
- 2 Lambda Calculus, Types, and Functional Programming
- 3 Functional Programming with Haskell
- 4 Formal Syntax for Fragments
- 5 Formal Semantics for Fragments
- 6 Model Checking with Predicate Logic
- 7 The Composition of Meaning in Natural Language
- 8 Extension and Intension
- 9 Parsing
- 10 Handling Relations and Scoping
- 11 Continuation Passing Style Semantics
- 12 Discourse Representation and Context
- 13 Communication as Informative Action
- Afterword
- Bibliography
- Index
3 - Functional Programming with Haskell
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Foreword
- Preface
- 1 Formal Study of Natural Language
- 2 Lambda Calculus, Types, and Functional Programming
- 3 Functional Programming with Haskell
- 4 Formal Syntax for Fragments
- 5 Formal Semantics for Fragments
- 6 Model Checking with Predicate Logic
- 7 The Composition of Meaning in Natural Language
- 8 Extension and Intension
- 9 Parsing
- 10 Handling Relations and Scoping
- 11 Continuation Passing Style Semantics
- 12 Discourse Representation and Context
- 13 Communication as Informative Action
- Afterword
- Bibliography
- Index
Summary
Summary
In this chapter we introduce the computational toolset that we are going to use throughout the book: the programming language Haskell. No prior knowledge of programming is assumed; you will learn everything you need to know about Haskell and (functional) programming as we go along.
The Programming Language Haskell
As a functional programming language, Haskell is a member of the Lisp family, as are Scheme, ML, Occam, Clean, and Erlang. It was designed to form a standard for functional programming languages and was named after the mathematician and logician Haskell B. Curry. We already mentioned that it is based on the lambda calculus, just like the other family members. In fact, Haskell is so faithful to its origins that it is purely functional, i.e. functions in Haskell do not have any side effects. (However, there is a way to perform computations with side effects, like change of state, in a purely functional fashion. We will come across this later on in the book, but it will not be of concern for us now.)
Three very important characteristic features of Haskell are the following. First, functions are first-class citizens. This means that functions may be passed as arguments to other functions and also can be returned as the result of some function. Second, functions are permitted to be recursive. The significance of this we will see in Section 3.5.
- Type
- Chapter
- Information
- Computational Semantics with Functional Programming , pp. 33 - 62Publisher: Cambridge University PressPrint publication year: 2010