Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 2.7 KB

overview.md

File metadata and controls

45 lines (34 loc) · 2.7 KB
id stdlib-overview
title Stdlib Overview
slug /stdlib/overview

Start with lists, options, and maps for data transformations. Add runtime modules when a script needs files, console I/O, serialization, or concurrency.

Availability

Surface Modules or names Available when
Core functions and values List, Option, Map, String, Int, Float, Bool, ignore Always, including JavaScript hosts
Default .NET runtime externs Console, Task, Fs, Json, Regex, Xml, Hash, Guid The host registers them; the CLI enables them by default
Execution metadata Env : Environment Injected by the CLI/REPL or supplied by an embedding host

No imports are needed for registered functions. An embedding host may expose a subset of the runtime catalog, and the CLI's --no-default-externs disables that catalog without removing core functions. The browser playground supplies its own capabilities; it does not load the .NET runtime.

ignore is a core function with type 'a -> unit: 42 |> ignore returns (). It needs no external provider. 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
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 an MD5 digest Hash
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.