Skip to main content
Version: Next

Stdlib Overview

Hosted interpreters grant no permissions by default. Each module page and the complete signature index identify the capabilities required by every function. Functions that require permissions need explicit host grants. See Host permissions.

The CLI makes the standard library available without imports.

Availability​

GroupModules or namesAvailability
Core functions and valuesList, Option, Map, String, Int, Float, Bool, Path, Glob, SemVer, ignoreAlways, including JavaScript hosts
Additional CLI modulesConsole, Task, Mailbox, Ref, Fs, Json, Regex, Xml, Hash, Encoding, Guid, Process, HttpEnabled by default in the CLI. Availability in embedded scripts depends on the host.
Exit statusEnv.setExitCode : int -> unitEffectful core operation; never terminates the host
Execution metadataEnv : EnvironmentInjected by the CLI/REPL or supplied by an embedding host

Use --no-default-externs or set runtime.default-externs = false to disable the additional CLI modules. See JavaScript embedding for package availability and host setup.

ignore is a core function with type 'a -> unit: 42 |> ignore returns (). Env is a host-supplied value, not a function. See Built-ins and Execution Metadata.

Choose a module​

TaskModule
Transform, filter, or fold a sequenceList
Handle optional values and defaultsOption
Look up and transform keyed valuesMap
Split, join, replace, or search textString
Parse and format scalar valuesInt, Float, Bool
Read or write console textConsole
Run concurrent work and await resultsTask
Send HTTP requests with headers and a bodyHttp
Launch a program and expose its async resultProcess
Process messages from concurrent producersMailbox
Store and replace a valueRef
Read, write, and discover filesFs
Decode and encode JSONJson
Extract regular-expression capture groupsRegex
Query XML element text and attributesXml
Compute a SHA-256 or MD5 digest of supplied contentHash
Manipulate path strings without IOPath
Match supplied paths against patternsGlob
Parse and compare semantic versionsSemVer
Transform UTF-8, Base64, hex, or URI componentsEncoding
Create a GUID stringGuid

Reading the signatures​

Functions are curried: Map.add key value map takes three arguments. Pipelines supply the final argument: map |> Map.add key value. Repeated type variables must agree; for example, 'a -> 'a option -> 'a uses one type throughout a call.

An option result distinguishes success (Some value) from absence or a supported recoverable failure (None). It does not promise that all failures are caught: for example, List.tail [] fails, and denied filesystem reads raise an error. Each module describes its boundary behavior.

Use the complete signature index for lookup, Native Types for literals and indexers, and Stdlib Recipes for small compositions.