liveBook · Manning

What you will learn in F# in Action: A Revised Edition of Get Programming with F#

by Isaac Abraham

Chapter by chapter

Chapter 1: Introducing F#

1.1 What is F#? · 1.2 Why F#? · 1.3 When F#? · 1.4 How will this book teach me F#? · 1.5 How does F# work? · 1.5.1 Collaborative exploration · 1.5.2 Type-driven development · 1.5.3 Trusting the compiler · 1.5.4 An opinionated language · 1.5.5 Data and functions · 1.5.6 Separation of business logic and external systems · 1.5.7 Varied targets · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: Hands on with F#

2.1 Writing code the F# way · 2.1.1 What, not how · 2.1.2 Composability · 2.1.3 Data and behavior · 2.1.4 Working with a smarter compiler · 2.2 F# and .NET · 2.3 Creating your first F# program · 2.3.1 Installing F# · 2.3.2 The .NET CLI · 2.3.3 Hello World in F# · 2.4 Getting Started with Visual Studio Code · 2.4.1 The Ionide extension · 2.4.2 Exploring F# with VS Code · 2.4.3 Writing your first F# · 2.5 REPL and scripts · 2.5.1 The F# REPL · 2.5.2 Trying out FSI · 2.5.3 Moving to interactive scripts · 2.5.4 State in the REPL · 2.5.5 Creating your first function · 2.6 Development flows · 2.7 Where scripts and the REPL fit in · 2.8 Summary

What you learn in chapter 2 →

Chapter 3: F# Syntax Basics

3.1 F# syntax basics · 3.1.1 Characteristics of F# syntax · 3.1.2 The let keyword · 3.1.3 Scoping · 3.2 Type inference · 3.2.1 Benefits of type inference · 3.2.2 Type inference basics · 3.2.3 Inferring generics · 3.2.4 Diagnosing unexpected type inference behavior · 3.2.5 Limitations of type inference · 3.2.6 Criticisms of type inference · 3.3 Exercise answers · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: F# Fundamentals

4.1 Expressions · 4.1.1 Purity and side effects · 4.1.2 Difficulties with statements · 4.1.3 Expressions to the rescue · 4.1.4 Expressions in F# · 4.1.5 Composability · 4.1.6 Unit · 4.1.7 Ignore · 4.2 Immutable data · 4.2.1 The problem with mutability · 4.2.2 Modeling with mutable and immutable data · 4.2.3 Optimizing and opinionated languages · 4.2.4 Other benefits of immutable data · 4.3 Exercise Answers · 4.4 Summary

What you learn in chapter 4 →

Chapter 5: Shaping data

5.1 Composing types in F# · 5.1.1 Data and functions in F# · 5.2 Tuples · 5.2.1 Tuple basics · 5.2.2 More on tuples · 5.2.3 Costs and benefits of tuples · 5.3 Records · 5.3.1 Defining, creating, and consuming records · 5.3.2 More on records · 5.3.3 Records and .NET · 5.4 Anonymous records · 5.4.1 Anonymous record tricks · 5.5 Tuples or records · 5.6 Exercise answers · 5.7 Summary

What you learn in chapter 5 →

Chapter 6: Functions and modules

6.1 Functions · 6.1.1 The truth behind F# functions · 6.1.2 Partially applying functions · 6.1.3 Pipelines · 6.1.4 Using records and tuples with functions · 6.1.5 Tupled functions · 6.1.6 Comparing functions and methods · 6.2 Organizing code · 6.2.1 Namespaces · 6.2.2 Modules · 6.2.3 Moving from script to application: A step-by-step exercise · 6.2.4 Referencing programs from scripts · 6.2.5 Best practices for modules and namespaces · 6.2.6 Tips and tricks · 6.3 Answers to exercises · 6.4 Summary

What you learn in chapter 6 →

Chapter 7: Working with collections

7.1 Higher-order functions · 7.2 Functional collection pipelines · 7.2.1 Imperative and declarative pipelines · 7.2.2 Debugging pipelines · 7.2.3 Understanding the List module · 7.2.4 Common List functions · 7.2.5 Ranges, slices, and indexing · 7.3 Other collection types · 7.3.1 Arrays · 7.3.2 Sequences · 7.3.3 ResizeArray · 7.3.4 Dictionary · 7.3.5 Map · 7.3.6 Set · 7.3.7 More on Sequences · 7.3.8 Comprehensions · 7.3.9 Comparing the different collection types · 7.4 Aggregations · 7.4.1 Imperative loops · 7.4.2 Functional folds · 7.4.3 Simulating Sequences · 7.5 Answers to exercises · 7.6 Summary

What you learn in chapter 7 →

Chapter 8: Patterns and unions

8.1 Introducing pattern matching · 8.1.1 Exhaustive matching · 8.1.2 Tuple matching · 8.1.3 Simplifying pattern matches: A worked example · 8.1.4 Record matching · 8.1.5 Type inference · 8.1.6 When guards · 8.2 More advanced pattern matching · 8.2.1 Recursive matching · 8.2.2 Nested or conditions · 8.2.3 Binding symbols · 8.2.4 Collection matching · 8.2.5 Match vs. if/then · 8.3 Discriminated unions · 8.3.1 Basics of discriminated unions · 8.3.2 Pattern matching · 8.3.3 Exhaustive matching with discriminated unions · 8.3.4 Nested types with discriminated unions · 8.3.5 Single-case discriminated unions · 8.4 The F# type system · 8.4.1 ANDing types · 8.4.2 ORing types · 8.4.3 ANDing values · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Building rich domains

9.1 Working with missing values · 9.1.1 The billion-dollar mistake: Working with nulls · 9.1.2 Options are the answer · 9.1.3 Option.map · 9.1.4 Option.bind · 9.1.5 Interop with .NET · 9.1.6 Options and collections · 9.2 Handling errors · 9.2.1 Results · 9.2.2 Handling multiple errors · 9.2.3 Strongly typed errors · 9.2.4 Exceptions · 9.2.5 When to safely leave options and results · 9.2.6 When to use options, results, and exceptions · 9.3 Computation expressions · 9.4 Domain modeling: A worked example · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Working effectively with data

10.1 Best practices · 10.1.1 Data is data · 10.1.2 Separation of data and functionality · 10.1.3 Don’t treat scripts as programs · 10.1.4 Working with lists of results · 10.2 Serialization of data · 10.2.1 Deserializing JSON to F# · 10.2.2 Acceptable alternatives to DTOs · 10.2.3 Serializing F# into JSON · 10.3 Type providers · 10.3.1 Working with the JSON type provider · 10.3.2 Working with external data sources · 10.3.3 More data types from FSharp.Data · 10.3.4 Best practices for type providers · 10.4 Data visualization · 10.5 Working with other data sources · 10.5.1 The CLIMutable attribute · 10.5.2 Working with SQL · 10.6 Tooling options · 10.7 Summary

What you learn in chapter 10 →

Chapter 11: F# Interop

11.1 Working with other .NET code · 11.1.1 Consuming C# classes · 11.1.2 Interfaces · 11.1.3 Fluent APIs · 11.1.4 Tuples · 11.1.5 Out parameters · 11.1.6 Object-based programming · 11.1.7 F# wrappers · 11.2 Exposing F# to C# · 11.2.1 Core F# concepts · 11.2.2 Tips and tricks · 11.2.3 Introducing F# into existing codebases · 11.3 Consuming NuGet packages · 11.3.1 Working with NuGet package dependencies · 11.3.2 Working with NuGet tools · 11.4 The Fable project: F# and JavaScript · 11.4.1 JavaScript to F#: A brief history · 11.4.2 Introducing Fable · 11.5 Summary

What you learn in chapter 11 →

Chapter 12: Asynchronous programming

12.1 What is asynchronous programming? · 12.1.1 Async and sync programming · 12.1.2 A brief history of async on .NET · 12.2 Asynchronous support in F# · 12.2.1 Tasks in .NET · 12.2.2 Consuming Tasks · 12.2.3 The task { } block: F#’s async/await · 12.2.4 Executing multiple Tasks in parallel · 12.2.5 Benefits of Tasks’ computation expressions · 12.2.6 The async block · 12.3 Final thoughts on asynchronous workloads · 12.3.1 The importance of immutable data · 12.3.2 The viral nature of asynchronous workloads · 12.4 Summary

What you learn in chapter 12 →

Chapter 13: Web programming

13.1 The web and functional programming · 13.1.1 Web programming on .NET and F# · 13.1.2 The HTTP Context · 13.2 Server-side web development in F# · 13.2.1 Creating our first ASP.NET application · 13.2.2 The HTTP Handler · 13.2.3 Composing HTTP Handlers together · 13.2.4 Composing multiple routes · 13.2.5 Writing our own HTTP Handlers · 13.2.6 Reading inputs · 13.2.7 Validation · 13.3 Functional patterns in a web application · 13.4 Creating HTML views · 13.4.1 Creating views through code · 13.4.2 The ViewEngine DSL · 13.4.3 Benefits of an F# DSL for HTML · 13.5 Full-stack F# apps with SAFE Stack · 13.5.1 Overview of SAFE Stack · 13.5.2 Installing the SAFE Stack template · 13.5.3 The MVU pattern · 13.5.4 Removing all ToDo items: A worked exercise · 13.6 Summary

What you learn in chapter 13 →

Chapter 14: Testing F# code

14.1 Automated tests: The value proposition · 14.1.1 F#: Types over tests · 14.2 Basic unit testing in F# · 14.2.1 Tests as functions · 14.2.2 Expecto · 14.2.3 Plugging Expecto into our code · 14.2.4 Advantages of Expecto · 14.3 Making testable code · 14.3.1 Preferring pure functions where possible · 14.3.2 Preferring smaller functions · 14.3.3 Unit testing small function hierarchies · 14.3.4 Integration testing higher-level composed functions · 14.3.5 Pushing side effects to the boundaries of your code · 14.3.6 Using higher-order functions to replace side effects · 14.3.7 Don’t worry about encapsulation · 14.4 Working with NUnit-style test frameworks · 14.5 Other forms of testing · 14.5.1 Performance testing · 14.5.2 Property-based testing · 14.6 Summary

What you learn in chapter 14 →

Chapter 15: Pure functional programming

15.1 A functional architecture pattern · 15.1.1 External and internal boundaries · 15.1.2 Structuring larger functional codebases · 15.2 Composing functions · 15.2.1 The object-oriented approach to composition · 15.2.2 Higher-order functions · 15.2.3 Dependency rejection · 15.2.4 Procedural composition · 15.2.5 What should you use and when? · 15.3 Working with low-level dependencies · 15.3.1 A worked example: Working with a logging function · 15.3.2 Flipping dependencies with a bootstrapper · 15.3.3 Pros and cons of the wireup pattern · 15.3.4 Applying the dependency rejection pattern · 15.4 Working with effects · 15.4.1 What are effects in F# and .NET? · 15.4.2 Common effects in F# · 15.4.3 Map and Bind · 15.4.4 Using Computation Expressions to hide bind pipelines · 15.5 Summary

What you learn in chapter 15 →

Chapter 16: Where next?

16.1 How do I start using F# in practice? · 16.1.1 Data analysis · 16.1.2 Hobby projects · 16.1.3 Coding challenges · 16.1.4 Before-and-after proof of concept · 16.1.5 Operational scripts · 16.2 How do I introduce F# to my team? · 16.3 The F# community · 16.3.1 Social media · 16.3.2 Conferences and user groups · 16.3.3 Open source · 16.4 Advanced F# language features · 16.4.1 Units of Measure · 16.4.2 Active Patterns · 16.4.3 Type Extensions · 16.4.4 Implicit Conversions · 16.4.5 Statically Resolved Type Parameters · 16.4.6 Metaprogramming · 16.5 Summary

What you learn in chapter 16 →

Concepts explained in this book

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.