let! is an F# computation-expression binding form for effectful results. In an option { } expression, it unwraps Some values, binds them to names, and stops with None when any computation fails. section 9.3
It replaces nested pattern matching and manual option checking with code that follows the successful, or happy-path, flow. The surrounding computation expression handles the effect and boilerplate. section 9.3
Binding several optional values
let myMaybeData = option { let! numberOne = tryParseNumber "1" let! numberTwo = tryParseNumber "2" let! numberThree = tryParseNumber "3" return calc numberOne numberTwo numberThree } Each tryParseNumber result is unwrapped only when it is Some. A None immediately returns None from the entire computation expression. section 9.3
The same pattern extends beyond options. Computation expressions can use let! with other effects, while do!, and!, and return! support unit effects, combined values, and direct effectful returns. Result expressions similarly unwrap Ok values and propagate Error values. section 15.4.4 section 9.3
