Delegate
A delegate is a type-safe callable reference to one or more methods whose signatures match a specified delegate type.
Functional Programming in C#, Second Edition
A C# delegate instance is a type-safe reference to one or more compatible methods.
- How it is used
- Represents operations as strongly typed values for functional-style programming, including custom comparisons passed to sorting.
- How deep it goes
- Defines compile-time type safety and the two-step declaration-and-implementation process, without exploring delegate internals.
- Examples
- Uses Comparison<T> to sort integers by their string representations.
- What you can do after
- Apply delegates by supplying a typed comparison implementation to sort a list.
Read how Functional Programming in C#, Second Edition explains delegate →
Fabulous Adventures in Data Structures and Algorithms
A delegate type is a C# type that represents a callable method signature and can hold a type-safe reference to a compatible method or function.
- How it is used
- Uses delegates to represent deferred concatenation inside an immutable Hughes list.
- How deep it goes
- Explains named delegate types, lambda construction, invocation, deferred work, complexity, and stack-depth consequences.
- Examples
- Demonstrates curried addition, a Concat delegate, Hughes-list construction, materialization, popping, and enumeration.
- What you can do after
- Build it from scratch as a deferred, type-safe function representation for efficient immutable-list accumulation.
Read how Fabulous Adventures in Data Structures and Algorithms explains delegate →
Also covered in
Related concepts
- first-class functionimplements · A first-class function is a function that can be treated as a value, such as being assigned, stored, passed as an argument, or returned.
- Func<T>includes · Func is a family of .NET generic delegate types representing functions with specified parameter types and a return type.
- lambdaused by · A lambda is an expression that defines an unnamed function, specifying its parameters and body and producing a callable value.
- Hughes listused by · A Hughes list is a functional list representation implemented with a binary tree while exposing linked-list features.
Questions about delegate
What is delegate?
A delegate is a type-safe callable reference to one or more methods whose signatures match a specified delegate type.
Which Manning books explain delegate?
Functional Programming in C#, Second Edition and Fabulous Adventures in Data Structures and Algorithms.
What kinds of delegate are there?
Kinds of delegate include Comparison<T>, EndpointFilterDelegate and Func<T>.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

