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
| Group | Modules or names | Availability |
|---|---|---|
| Core functions and values | List, Option, Map, String, Int, Float, Bool, Path, Glob, SemVer, ignore | Always, including JavaScript hosts |
| Additional CLI modules | Console, Task, Mailbox, Ref, Fs, Json, Regex, Xml, Hash, Encoding, Guid, Process, Http | Enabled by default in the CLI. Availability in embedded scripts depends on the host. |
| Exit status | Env.setExitCode : int -> unit | Effectful core operation; never terminates the host |
| Execution metadata | Env : Environment | Injected 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
| Task | Module |
|---|---|
| Transform, filter, or fold a sequence | List |
| Handle optional values and defaults | Option |
| Look up and transform keyed values | Map |
| Split, join, replace, or search text | String |
| Parse and format scalar values | Int, Float, Bool |
| Read or write console text | Console |
| Run concurrent work and await results | Task |
| Send HTTP requests with headers and a body | Http |
| Launch a program and expose its async result | Process |
| Process messages from concurrent producers | Mailbox |
| Store and replace a value | Ref |
| Read, write, and discover files | Fs |
| Decode and encode JSON | Json |
| Extract regular-expression capture groups | Regex |
| Query XML element text and attributes | Xml |
| Compute a SHA-256 or MD5 digest of supplied content | Hash |
| Manipulate path strings without IO | Path |
| Match supplied paths against patterns | Glob |
| Parse and compare semantic versions | SemVer |
| Transform UTF-8, Base64, hex, or URI components | Encoding |
| Create a GUID string | Guid |
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.