CONTENTS

Introduction

Part I : Introduction to Functional Programming

Chapter 1 : A Look at Functional Programming History

What Is Functional Programming?

Functional Languages

The Relationship to Object Oriented Programming

Summary

Chapter 2 : Putting Functional Programming into a Modern Context

Managing Side Effects

Agile Programming Methodologies

Declarative Programming

Functional Programming Is a Mindset

Is Functional Programming in C# a Good Idea?

Summary

Part II : C# FOUNDATIONS OF FUNCTIONAL PROGRAMMING

Chapter 3 : Functions, Delegates, and Lambda Expressions

Functions and Methods

Reusing Functions

Anonymous Functions and Lambda Expressions

Extension Methods

Referential Transparency

Summary

Chapter 4 : Flexible Typing with Generics

Generic Functions

Generic Classes

Constraining Types

Other Generic Types

Covariance and Contravariance

Summary

Chapter 5 : Lazy Listing with Iterators

The Meaning of Laziness

Enumerating Things with .NET

Implementing Iterator Functions

Chaining Iterators

Summary

Chapter 6 : Encapsulating Data in Closures

Constructing Functions Dynamically

The Problem with Scope

How Closures Work

Summary

Chapter 7 : Code Is Data

Expression Trees in .NET

Analyzing Expressions

Generating Expressions

.NET 4.0 Specifics

Summary

Part III : Implementing Well-known Functional Techniques in C#

Chapter 8 : Currying and Partial Application

Decoupling Parameters

Calling Parts of Functions

Why Parameter Order Matters

Summary

Chapter 9 : Lazy Evaluation

What’s Good about Being ...

Get Functional Programming in C#: Classic Programming Techniques for Modern Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.