Repository F# setup
open System
open System.IO
open System.Threading
open System.Threading.Tasks
open Axial
open Axial.Layers
open Axial.Console
open Axial.FileSystem
open Axial.Hosting
open Axial.Hosting.Browser
open Axial.Hosting.Node
open Axial.HttpClient
open Axial.PlatformService
open Axial.Process
open Axial.State
open Axial.Telemetry
open Axial.Telemetry.JavaScript

Combining Flows

Use Flow.map when only the successful value changes:

loadUser userId
|> Flow.map _.DisplayName
Use `Flow.mapError` when the caller needs a different expected error type:
loadUser userId
|> Flow.mapError UserLoadFailed
Use `Flow.bind` for dependent work. It is the function form of `let!`:
loadUser userId
|> Flow.bind sendGreeting
Use `Flow.zip` when two descriptions should run sequentially and both values are needed:
Flow.zip loadProfile loadPreferences
// Flow<AppEnv, AppError, Profile * Preferences>
`Flow.map2` and `Flow.map3` combine the successful values directly. Concurrent composition is a separate choice; use `Flow.zipPar` only when both branches are safe to run at the same time.

Prefer flow {} for a longer dependent sequence and pipelines for a short transformation. They create the same Flow model and differ only in how the code reads.

Go Further

  • Composition reference lists mapping, binding, recovery, traversal, and sequential combination functions.
  • Fibers introduces explicit child workflows.
  • Schedules adds retry and repetition policies without changing the underlying workflow.