Repository F# setup
open System
open System.IO
open System.Threading
open System.Threading.Tasks
open Axial
open Axial.Console
open Axial.FileSystem
open Axial.Hosting
open Axial.Hosting.Browser
open Axial.Hosting.Node
open Axial.State
open Axial.Telemetry
open Axial.Telemetry.JavaScriptStreams
A Flow produces one result. A FlowStream produces values over time without first loading all of them into memory.
Use it when the input may be large, slow, or unbounded: paginated APIs, message subscriptions, and incremental file
or network adapters.
> (FlowStream.fromSeq [ 1..6 ] : FlowStream<int>)
- |> FlowStream.filter (fun number -> number % 2 = 0)
- |> FlowStream.map (fun number -> number * 10)
- |> FlowStream.runCollect
- |> Flow.run ();;val it: Exit<int list,Never> = Success [20; 40; 60]Axial.FlowStreamModulefromSeq: 'value seq -> FlowStream<'env,'error,'value>Creates a stream from a synchronous sequence of values. The sequence of values to be emitted by the stream. A that yields each value from the sequence. FlowStream.fromSeq [1..10] |> FlowStream.runCollect |> Flow.run ()
(..): ^T -> ^T -> ^T seqThe standard overloaded range operator, e.g. [n..m] for lists, seq {n..m} for sequences The start value of the range. The end value of the range. The sequence spanning the range. [1..4] // Evaluates to [1; 2; 3; 4] [1.5..4.4] // Evaluates to [1.5; 2.5; 3.5] ['a'..'d'] // Evaluates to ['a'; 'b'; 'c'; 'd'] [|1..4|] // Evaluates to an array [|1; 2; 3; 4|] { 1..4 } // Evaluates to a sequence [1; 2; 3; 4])
FlowStreamA stream with no environment requirement and no typed failure.
intAn abbreviation for the CLI type . Basic Types
(|>): 'T1 -> ('T1 -> 'U) -> 'UApply a function to a value, the value being on the left, the function on the right The argument. The function. The function result. let doubleIt x = x * 2 3 |> doubleIt // Evaluates to 6
filter: ('a -> bool) -> FlowStream<'b,'c,'a> -> FlowStream<'b,'c,'a>Keeps values that satisfy a predicate. stream |> FlowStream.filter (fun value -> value > 0)
number: int(%): ^T1 -> ^T2 -> ^T3Overloaded modulo operator The first parameter. The second parameter. The result of the operation. 29 % 5 // Evaluates to 4
(=): 'T -> 'T -> boolStructural equality The first parameter. The second parameter. The result of the comparison. 5 = 5 // Evaluates to true 5 = 6 // Evaluates to false [1; 2] = [1; 2] // Evaluates to true (1, 5) = (1, 6) // Evaluates to false
map: ('v -> 'w) -> FlowStream<'env,'error,'v> -> FlowStream<'env,'error,'w>Transforms the successful values of a stream using the provided function. The function to transform each value. The stream whose values should be transformed. A new stream that yields transformed values. let stream = FlowStream.fromSeq [1; 2; 3] |> FlowStream.map (fun n -> n * 2)
(*): ^T1 -> ^T2 -> ^T3Overloaded multiplication operator The first parameter. The second parameter. The result of the operation. 8 * 6 // Evaluates to 48
runCollect: FlowStream<'a,'b,'c> -> Flow<'a,'b,'c list>Collects all emitted values into a list. stream |> FlowStream.runCollect
Axial.Flowrun: 'env -> Flow<'env,'error,'value> -> Exit<'value,'error>Runs the workflow and blocks until the final exit is available. The environment used by the workflow. The workflow to run. The final workflow exit. let exit = workflow |> Flow.run environment
The stream is cold: constructing it starts nothing. It is pull-based: downstream asks for each next value, and
operators pull upstream only as far ahead as their buffers allow, so backpressure is bounded. mapFlowPar and the
timed/switchMapFlow operators read ahead by a fixed number of values, and fromCallback drops values when its
fixed-size buffer is full rather than blocking the producer. It shares Flow's environment, typed failures,
cancellation, scopes, and structured fibers.
Getting started builds one complete stream.
Guides
- Getting started: construct, transform, and consume one stream.
- Constructing streams: existing values, one Flow, and effectful unfolding.
- Transforming values: pure and effectful operators.
- Batching and parallelism: strict batches versus continuously replenished work.
- Composing streams: append, flatten, and zip.
- Consuming streams: folds, incremental effects, collection, and resource cleanup.
- Platform boundary: portable stream mechanics and host-specific adapters.
- Time and latest: throttling, debouncing, and switching to the latest input.
- Resources and results: resource-backed streams and partial-result terminals.
- Crawler recipe: a concurrent link crawler from
unfoldFlow,mapFlowPar, andcollect.
For one OS integration example, see the Process guide's Streaming output page. It explains
how Axial.Process exposes stdout and stderr as a FlowStream; process handling is not part of the stream model.
The FlowStream API lists every operator.

