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.JavaScriptIRandom and IGuid exist for the same reason as the clock: a workflow that calls Guid.NewGuid() directly cannot
be asserted against, and one that declares the dependency can.
open System
open Axial
open Axial.PlatformService
SystemAxialPlatformServiceRandom.next // non-negative int
Random.nextMax exclusiveMax // 0 <= value < exclusiveMax
Random.nextInt minimum maximum // minimum <= value < maximum
Random.nextDouble // 0.0 <= value < 1.0
Random.nextBytes buffer // fills an existing buffer
Random.bytes count // allocates and fills a new arrayRandom.live is backed by the platform generator. Two doubles cover most tests: Random.fromValue returns the same
integer from every method, and Random.fromFixed integer double byte pins the three value kinds separately when a
test cares about the difference.
None of these are cryptographic. For key material or tokens, use a cryptographic generator behind your own service
contract rather than IRandom.
GUIDs
IGuid has one member. Guid.newGuid reads it:
let tagged name : Flow<#IHasGuid, Never, string> =
Guid.newGuid |> Flow.map (fun id -> $"{name}-{id}")
tagged: 'a -> Flow<'b,Never,string>name: 'aAxial.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.IHasGuidDeclares that an environment supplies the GUID service.
Axial.NeverRepresents an error channel that cannot occur.
stringAn abbreviation for the CLI type . Basic Types
Axial.PlatformService.GuidHelpers for the GUID service.
newGuid: Flow<'env,'error,Guid>Reads a GUID from an explicit GUID service.
(|>): '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
Axial.Flowmap: ('value -> 'next) -> Flow<'env,'error,'value> -> Flow<'env,'error,'next>Transforms the successful value of a flow. If the source fails, the is not executed. The original failure cause is preserved, including typed failures, interruption, and defects. Use map for pure value transformations after an effect has succeeded. A function of type 'value -> 'next to transform the successful value. The source flow of type to transform. A new with the transformed success value of type 'next. let flow = Flow.succeed 1 |> Flow.map (fun x -> x + 1)
id: Guidlet guid = Guid.fromValue (System.Guid.Parse "11111111-1111-1111-1111-111111111111")
guid: IGuidAxial.PlatformService.GuidHelpers for the GUID service.
fromValue: Guid -> IGuidCreates a deterministic GUID service that always returns the supplied value.
SystemParse: string -> GuidConverts the string representation of a GUID to the equivalent structure. The string to convert. A structure that contains the value that was parsed. is . is not in a recognized format.
System.GuidRepresents a globally unique identifier (GUID).
Both services are part of the base runtime, so applications usually receive them as one bundle rather than wiring each.

