Flow
This page shows the source-documented Flow surface: the core type and module functions.
Core type
FsFlow.Flow: Represents a cold workflow that reads an environment, returns a typed result, and is executed explicitly throughFlow.run.
Module functions
FsFlow.Flow.run: Executes a flow with the provided environment and the default cancellation token.FsFlow.Flow.ok: Creates a successful synchronous flow.FsFlow.Flow.error: Creates a failing synchronous flow.FsFlow.Flow.succeed: Alias forokthat reads well in some call sites.FsFlow.Flow.value: Alias forokthat reads well in some call sites.FsFlow.Flow.fail: Alias forerrorthat reads well in some call sites.FsFlow.Flow.fromResult: Lifts aResultinto a synchronous flow.FsFlow.Flow.fromOption: Lifts an option into a synchronous flow with the supplied error.FsFlow.Flow.fromValueOption: Lifts a value option into a synchronous flow with the supplied error.FsFlow.Flow.orElseFlow: Turns a pure validation result into a synchronous flow with environment-provided failure.FsFlow.Flow.env: Reads the current environment as the flow value.FsFlow.Flow.read: Projects a value from the current environment.FsFlow.Flow.map: Maps the successful value of a synchronous flow.FsFlow.Flow.bind: Sequences a synchronous continuation after a successful value.FsFlow.Flow.tap: Runs a synchronous side effect on success and preserves the original value.FsFlow.Flow.tapError: Runs a synchronous side effect on failure and preserves the original error.FsFlow.Flow.mapError: Maps the error value of a synchronous flow.FsFlow.Flow.catch: Catches exceptions raised during execution and maps them to a typed error.FsFlow.Flow.orElseWith: Falls back to another flow when the source flow fails.FsFlow.Flow.orElse: Falls back to another flow when the source flow fails.FsFlow.Flow.zip: Combines two flows into a tuple of their values.FsFlow.Flow.map2: Combines two flows with a mapping function.FsFlow.Flow.map3: Combines three flows with a mapping function.FsFlow.Flow.apply: Applies a flow-wrapped function to a flow-wrapped value.FsFlow.Flow.ignore: Maps the successful value of a synchronous flow tounit.FsFlow.Flow.localEnv: Transforms the environment before running the flow.FsFlow.Flow.provideLayer: Provides a derived environment from a layer flow to a downstream flow.FsFlow.Flow.delay: Defers flow construction until execution time.FsFlow.Flow.traverse: Transforms a sequence of values into a flow and stops at the first failure.FsFlow.Flow.sequence: Transforms a sequence of flows into a flow of a sequence and stops at the first failure.
Concurrency
FsFlow.Fiber: Represents a handle to a running workflow.FsFlow.Flow.fork: Starts a flow in a new fiber without waiting for it to complete.FsFlow.Flow.join: Waits for a fiber to complete and returns its final outcome.FsFlow.Flow.interrupt: Signals a fiber to stop and waits for it to finish its cleanup.
Parallel orchestration
FsFlow.Flow.zipPar: Combines two flows into a tuple of their values, running them concurrently.FsFlow.Flow.race: Runs two flows concurrently and returns the result of the first one to complete.