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.JavaScriptSupplying Platform Services
A host needs the standard operational services before it can run application workflows: a clock, a logger,
randomness, GUIDs, and environment variables. Axial.PlatformService bundles all five as BaseRuntime.
The shortest path is the live bundle:
open Axial
open Axial.PlatformService
AxialPlatformServicelet runtime : BaseRuntime = BaseRuntime.liveValue
runtime: BaseRuntimeAxial.PlatformService.BaseRuntimeGroups the standard operational services commonly used by workflow hosts.
Axial.PlatformService.BaseRuntimeModuleHelpers for constructing the standard explicit service bundle used by workflow hosts.
liveValue: BaseRuntimeCreates the standard live base runtime as an explicit service bundle.
let startup : Flow<BaseRuntime, EnvironmentVariableError, int> =
flow {
let! port = EnvironmentVariable.getInt "PORT"
do! Log.info $"Listening on {port}"
return port
}
startup: Flow<BaseRuntime,EnvironmentVariableError,int>Axial.Flow`3Represents a cold workflow that reads an environment, returns a typed result, and is executed explicitly through one of its execution members such as ToTask, ToAsync, or RunSynchronously. The type of the environment dependency. The type of the failure value. The type of the success value.
Axial.PlatformService.BaseRuntimeGroups the standard operational services commonly used by workflow hosts.
Axial.PlatformService.EnvironmentVariableErrorintAn abbreviation for the CLI type . Basic Types
flow: FlowBuilderThe universal flow { } computation expression.
port: intAxial.PlatformService.EnvironmentVariableHelpers for reading and parsing environment variables through an explicit service.
getInt: string -> Flow<'env,EnvironmentVariableError,int>Reads an integer environment variable through an explicit service.
Axial.PlatformService.LogHelpers for the logging service.
info: string -> Flow<'env,'error,unit>Writes an informational log message through an explicit logging service.
Use BaseRuntime.live when the environment is composed from layers, and BaseRuntime.fromServiceProvider when the
host already has an IServiceProvider — that variant reports missing registrations as typed BaseRuntimeError
startup failures rather than resolution exceptions.
Applications normally extend the bundle with their own services rather than using it bare; see building a base runtime.
Go further
Full documentation for each service — the operation surface, the deterministic test doubles, and the typed environment-variable error model — is in platform services under built-in services.

