4 ms·
F#'s "Computation expressions" are the same sort of thing as the mentioned Haskell's "do notation" and Scala's "for comprehension". They're just thin syntactic
by sideeffffect 5y ago
F#'s "Computation expressions" are the same sort of thing as the mentioned Haskell's "do notation" and Scala's "for comprehension". They're just thin syntactic sugar for "callbacks" -- chaining maps/binds/flatmaps/etc. Even though F#'s "Computation expressions" are very cleverly thought out and more general.
https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...
Async/await for example in C# or Rust is different. This translates the program into transition automata/coroutines.