
The Book of F#
Breaking Free with Managed Functional Programming
Publisher: No Starch Press
Release Date: March 2014
Pages: 312
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
F# brings the power of functional-first programming to the .NET Framework, a platform for developing software in the Microsoft Windows ecosystem. If you're a traditional .NET developer used to C# and Visual Basic, discovering F# will be a revelation that will change how you code, and how you think about coding.
In The Book of F#, Microsoft MVP Dave Fancher shares his expertise and teaches you how to wield the power of F# to write succinct, reliable, and predictable code. As you learn to take advantage of features like default immutability, pipelining, type inference, and pattern matching, you'll be amazed at how efficient and elegant your code can be.
You'll also learn how to:
- Exploit F#'s functional nature using currying, partial application, and delegation
- Streamline type creation and safety with record types and discriminated unions
- Use collection types and modules to handle data sets more effectively
- Use pattern matching to decompose complex types and branch your code within a single expression
- Make your software more responsive with parallel programming and asynchronous workflows
- Harness object orientation to develop rich frameworks and interact with code written in other .NET languages
- Use query expressions and type providers to access and manipulate data sets from disparate sources
Break free of that old school of programming. The Book of F# will show you how to unleash the expressiveness of F# to create smarter, leaner code.
Table of Contents
-
Chapter 1 Meet F#
-
F# in Visual Studio
-
Significance of Whitespace
-
Grouping Constructs
-
Expressions Are Everywhere
-
Application Entry Point
-
Implicit Return Values
-
Your First F# Program
-
Summary
-
-
Chapter 2 F# Interactive
-
Running F# Interactive
-
F# Interactive Output
-
The it Identifier
-
Playing in the Sandbox
-
Scripting
-
F# Interactive Options
-
Summary
-
-
Chapter 3 Fundamentals
-
Immutability and Side Effects
-
Functional Purity
-
Bindings
-
Identifier Naming
-
Core Data Types
-
Type Inference
-
Nullability
-
Enumerations
-
Flow Control
-
Generics
-
When Things Go Wrong
-
String Formatting
-
Type Abbreviations
-
Comments
-
Summary
-
-
Chapter 4 Staying Objective
-
Classes
-
Structures
-
Inheritance
-
Static Members
-
Mutually Recursive Types
-
Interfaces
-
Custom Operators
-
Object Expressions
-
Type Extensions
-
Summary
-
-
Chapter 5 Let’s Get Functional
-
What Is Functional Programming?
-
Programming with Functions
-
Currying
-
Recursive Functions
-
Lambda Expressions
-
Closures
-
Functional Types
-
Discriminated Unions
-
Lazy Evaluation
-
Summary
-
-
Chapter 6 Going to Collections
-
Sequences
-
Arrays
-
Lists
-
Sets
-
Maps
-
Converting Between Collection Types
-
Summary
-
-
Chapter 7 Patterns, Patterns, Everywhere
-
Match Expressions
-
Exhaustive Matching
-
Matching Constant Values
-
Identifier Patterns
-
Matching Nulls
-
Matching Tuples
-
Matching Records
-
Matching Collections
-
Matching by Type
-
As Patterns
-
Combining Patterns with AND
-
Combining Patterns with OR
-
Parentheses in Patterns
-
Active Patterns
-
Partial Active Patterns
-
Parameterized Active Patterns
-
Summary
-
-
Chapter 8 Measuring Up
-
Defining Measures
-
Measure Formulas
-
Applying Measures
-
Stripping Measures
-
Enforcing Measures
-
Ranges
-
Converting Between Measures
-
Generic Measures
-
Custom Measure-Aware Types
-
Summary
-
-
Chapter 9 Can I Quote You on that?
-
Comparing Expression Trees and Quoted Expressions
-
Composing Quoted Expressions
-
Decomposing Quoted Expressions
-
Summary
-
-
Chapter 10 Show Me the Data
-
Query Expressions
-
Type Providers
-
Summary
-
-
Chapter 11 Asynchronous and Parallel Programming
-
Task Parallel Library
-
Asynchronous workflows
-
Agent-Based Programming
-
Summary
-
-
Chapter 12 Computation Expressions
-
Anatomy of a Computation Expression
-
Example: FizzBuzz
-
Example: Building Strings
-
Summary
-