F# error handling: Result pipelines and computation expressions
10 steps · about 5 h 10 min · Intermediate
- Tour of F# (doc, Microsoft Learn, 30 min)
Gives you the pipe operator, unions and pattern matching that every later step relies on.
- Results - F# (reference, Microsoft Learn, 15 min)
Shows the official Result type, with Ok and Error, and Result.bind used in a short validation example.
- Railway oriented programming (article, F# for Fun and Profit (Scott Wlaschin), 40 min)
Builds bind, map and the two-track model step by step, so you see why pipelines short-circuit on the first error.
- Railway Oriented Programming: error handling in functional languages (NDC London) (video, Scott Wlaschin, NDC, 1 h)
The author's own talk walks through the same ideas visually and covers logging and exceptions.
- The 'Computation Expressions' series (guide, F# for Fun and Profit (Scott Wlaschin), 45 min)
Use the series index to follow continuations, bind and wrapper types, which explain how a result builder works.
- Implementing a CE: Combine (article, F# for Fun and Profit (Scott Wlaschin), 25 min)
Explains how return and sequencing behave, which prevents surprises when you write your own builder.
- Computation Expressions - F# (reference, Microsoft Learn, 30 min)
The official reference lists every builder member (Bind, Return, Zero and more) that you can use to check your own builder.
- Computation Expression - FsToolkit.ErrorHandling (doc, FsToolkit.ErrorHandling docs, 20 min)
Applies a ready-made result { } builder to a login flow with requireSome, requireTrue and mapError, so you don't write the builder yourself.
- Computation Expression - FsToolkit.ErrorHandling (AsyncResult) (doc, FsToolkit.ErrorHandling docs, 20 min)
Extends the same pipeline to asynchronous steps, which is what real services need.
- FsToolkit.ErrorHandling: An opinionated F# library for error handling (repo, GitHub (demystifyfp), 25 min)
Finish by reading the library's README and its links on when not to use Result, so you can judge where it fits.