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.JavaScriptYour First Application
Use App.run when a Flow is the root of an application. It carries cancellation from the calling Async and returns
after the root scope and its resources have closed.
open Axial
let application : Flow<string> =
flow {
return "Hello from Flow"
}
let run () =
async {
let! exit = App.run () application
match exit with
| Exit.Success message -> printfn "%s" message
| Exit.Failure cause -> printfn "%s" (Cause.prettyPrint string cause)
}
Axialapplication: Flow<string>FlowA flow that requires no environment and cannot fail with a typed error.
stringAn abbreviation for the CLI type . Basic Types
flow: FlowBuilderThe universal flow { } computation expression.
run: unit -> Async<unit>async: AsyncBuilderBuilds an asynchronous workflow using computation expression syntax. let sleepExample() = async { printfn "sleeping" do! Async.Sleep 10 printfn "waking up" return 6 } sleepExample() |> Async.RunSynchronously
exit: Exit<string,Never>Axial.AppStarts and controls root Flow applications without requiring an external hosting framework.
run: 'env -> Flow<'env,'error,'value> -> Async<Exit<'value,'error>>Runs a root workflow to completion using the caller's asynchronous cancellation token. The explicit environment supplied to the root workflow. The root workflow to run. The final exit after the root scope has closed. Fable compatible
Axial.Exit`2Represents the final outcome of a workflow execution. The type of the success value. The type of the domain-specific failure value.
SuccessThe workflow completed successfully.
message: stringprintfn: Printf.TextWriterFormat<'T> -> 'TPrint to stdout using the given format, and add a newline. The formatter. The formatted result. See Printf.printfn (link: ) for examples.
FailureThe workflow failed due to a specific cause.
cause: Cause<Never>Axial.CauseprettyPrint: ('error -> string) -> Cause<'error> -> stringPretty prints a cause tree for diagnostics.
string: 'T -> stringConverts the argument to a string using ToString. For standard integer and floating point values and any type that implements IFormattable, ToString conversion uses CultureInfo.InvariantCulture. The input value. The converted string. string 'A' // evaluates to "A" string 0xff // evaluates to "255" string -10 // evaluates to "-10"
Use App.start when a signal handler, desktop window, UI component, or external host will request shutdown later.
The Application Lifecycle guide covers start and stop ownership. Hosting guides show the .NET, Node, and browser boundaries.
You now have the complete introductory path: describe work, compose it, distinguish outcomes, provide dependencies, and run one root workflow.
Go further
- Application Lifecycle covers
App.start, coordinated stop, and lifecycle ownership. - Scopes and Resources explains finalizers and acquisition/release safety.
- Hosting connects the root application to .NET, Node, or browser hosts.

