Standard Library Signature Index
This is the standard library catalog for the FScript CLI. Each name links to argument order, examples, and failure behavior. Type variables are local to each signature; repeated variables in a row must agree.
Embedded environments may expose different modules. See standard library availability. None means that the function requires no capabilities. The Host permissions column applies to hosted and interpreted CLI execution, both defaulting to none. CLI flags or the selected manifest can grant permissions. Compilation remains unrestricted. Provider FFI requires Native. Callbacks retain their own permission requirements. See Host permissions.
Top-level surface
| Name | Type | Availability | Host permissions |
|---|---|---|---|
ignore | 'a -> unit | Core function; evaluates and discards its argument | None |
Env | Environment | Value injected by CLI/REPL, optional in embedding hosts | None |
Environment | { ScriptName: string option; Arguments: string list } | Built-in record type | None |
FsKind | File of string / Directory of string / Missing | Built-in union type | None |
Core library
Bool
| Name | Signature | Host permissions |
|---|---|---|
Bool.toString | bool -> string | None |
Bool.tryParse | string -> bool option | None |
Float
| Name | Signature | Host permissions |
|---|---|---|
Float.toString | float -> string | None |
Float.tryParse | string -> float option | None |
Int
| Name | Signature | Host permissions |
|---|---|---|
Int.toString | int -> string | None |
Int.tryParse | string -> int option | None |
List
| Name | Signature | Host permissions |
|---|---|---|
List.append | 'a list -> 'a list -> 'a list | None |
List.choose | ('a -> 'b option) -> 'a list -> 'b list | None |
List.collect | ('a -> 'b list) -> 'a list -> 'b list | None |
List.contains | 'a -> 'a list -> bool | None |
List.distinct | 'a list -> 'a list | None |
List.empty | 'a list | None |
List.exists | ('a -> bool) -> 'a list -> bool | None |
List.filter | ('a -> bool) -> 'a list -> 'a list | None |
List.fold | ('b -> 'a -> 'b) -> 'b -> 'a list -> 'b | None |
List.iter | ('a -> unit) -> 'a list -> unit | None |
List.length | 'a list -> int | None |
List.map | ('a -> 'b) -> 'a list -> 'b list | None |
List.rev | 'a list -> 'a list | None |
List.tail | 'a list -> 'a list | None |
List.tryFind | ('a -> bool) -> 'a list -> 'a option | None |
List.tryGet | ('a -> bool) -> 'a list -> int option | None |
List.tryHead | 'a list -> 'a option | None |
List.tryItem | int -> 'a list -> 'a option | None |
Map
| Name | Signature | Host permissions |
|---|---|---|
Map.add | 'b -> 'a -> 'a map['b] -> 'a map['b] | None |
Map.choose | ('b -> 'a -> 'c option) -> 'a map['b] -> 'c map['b] | None |
Map.containsKey | 'b -> 'a map['b] -> bool | None |
Map.count | 'a map['b] -> int | None |
Map.empty | 'a map['b] | None |
Map.filter | ('b -> 'a -> bool) -> 'a map['b] -> 'a map['b] | None |
Map.fold | ('c -> 'b -> 'a -> 'c) -> 'c -> 'a map['b] -> 'c | None |
Map.iter | ('b -> 'a -> unit) -> 'a map['b] -> unit | None |
Map.map | ('a -> 'c) -> 'a map['b] -> 'c map['b] | None |
Map.ofList | ('b * 'a) list -> 'a map['b] | None |
Map.remove | 'b -> 'a map['b] -> 'a map['b] | None |
Map.tryGet | 'b -> 'a map['b] -> 'a option | None |
Option
| Name | Signature | Host permissions |
|---|---|---|
Option.defaultValue | 'a -> 'a option -> 'a | None |
Option.defaultWith | (unit -> 'a) -> 'a option -> 'a | None |
Option.isNone | 'a option -> bool | None |
Option.isSome | 'a option -> bool | None |
Option.map | ('a -> 'b) -> 'a option -> 'b option | None |
String
| Name | Signature | Host permissions |
|---|---|---|
String.concat | string -> string list -> string | None |
String.endsWith | string -> string -> bool | None |
String.indexOf | string -> string -> int option | None |
String.replace | string -> string -> string -> string | None |
String.split | string -> string -> string list | None |
String.substring | int -> int -> string -> string option | None |
String.toLower | string -> string | None |
String.toUpper | string -> string | None |
I/O, concurrency, and data utilities
Ref
| Name | Signature | Host permissions |
|---|---|---|
Ref.create | 't -> Ref<'t> | None |
Ref.get | Ref<'t> -> 't | None |
Ref.set | 't -> Ref<'t> -> unit | None |
Console
| Name | Signature | Host permissions |
|---|---|---|
Console.readLine | unit -> string option | IO Interactive |
Console.writeLine | string -> unit | IO |
Fs
| Name | Signature | Host permissions |
|---|---|---|
Fs.combinePath | string -> string -> string | None |
Fs.createDirectory | string -> bool | IO |
Fs.enumerateFiles | string -> string -> string list option | IO |
Fs.exists | string -> bool | IO |
Fs.extension | string -> string option | None |
Fs.fileNameWithoutExtension | string -> string | None |
Fs.glob | string -> string list option | IO |
Fs.kind | string -> FsKind | IO |
Fs.parentDirectory | string -> string option | None |
Fs.readText | string -> string option | IO |
Fs.writeText | string -> string -> bool | IO |
Guid
| Name | Signature | Host permissions |
|---|---|---|
Guid.new | 'a -> string option | IO |
Hash
| Name | Signature | Host permissions |
|---|---|---|
Hash.md5 | string -> string option | None |
Json
| Name | Signature | Host permissions |
|---|---|---|
Json.deserialize<'a> | string -> 'a option | None |
Json.serialize | 'a -> string option | None |
Mailbox
| Name | Signature | Host permissions |
|---|---|---|
Mailbox.start | int -> ('state -> 'message -> 'state) -> 'state -> Mailbox<'message, 'state> | Threading |
Mailbox.post | 'message -> Mailbox<'message, 'state> -> unit | Threading |
Mailbox.finish | Mailbox<'message, 'state> -> 'state | Threading |
Regex
| Name | Signature | Host permissions |
|---|---|---|
Regex.matchGroups | string -> string -> string list option | None |
Task
| Name | Signature | Host permissions |
|---|---|---|
Task.spawn | (unit -> 'a) -> 'a task | Threading |
Task.delay | int -> unit task | Threading |
Task.fromResult | 'a -> 'a task | Threading |
Task.continueWith | ('a -> 'b) -> 'a task -> 'b task | Threading |
Task.whenAll | ('a list -> 'b) -> 'a task list -> 'b task | Threading |
Task.whenAny | ('a -> 'b) -> 'a task list -> 'b task | Threading |
Task.await | 'a task -> 'a | Threading |
Task.awaitAll | 'a task list -> 'a list | Threading |
Xml
| Name | Signature | Host permissions |
|---|---|---|
Xml.queryValues | string -> string -> string list option | None |
Syntax and data forms
Constructors and syntax are separate from function registration: Some/None, union cases, literals, ranges, field access, list/map indexers, typeof, and nameof are covered in Native Types and Syntax and Operators. Host-provided type descriptors are covered in Host-Provided Types.
Json.deserialize<Settings> json returns Settings option. The expected result type can also determine the target. Guid.new accepts an ignored argument; use Guid.new (). List.contains compares scalars only; use List.exists with = for composite data.
Env.setExitCode : int -> unit selects the eventual shell status without stopping evaluation; see core builtins. It is effectful and accepts codes 0..255.
Expanded pure support library
Int additions
| Name | Signature | Host permissions |
|---|---|---|
Int.abs | int -> int | None |
Int.sign | int -> int | None |
Int.min | int -> int -> int | None |
Int.max | int -> int -> int | None |
Int.clamp | int -> int -> int -> int | None |
Int.toFloat | int -> float | None |
Float additions
| Name | Signature | Host permissions |
|---|---|---|
Float.abs | float -> float | None |
Float.sign | float -> int | None |
Float.min | float -> float -> float | None |
Float.max | float -> float -> float | None |
Float.clamp | float -> float -> float -> float | None |
Float.floor | float -> float | None |
Float.ceil | float -> float | None |
Float.round | float -> float | None |
Float.truncate | float -> float | None |
Float.sqrt | float -> float | None |
Float.log | float -> float | None |
Float.log10 | float -> float | None |
Float.exp | float -> float | None |
Float.sin | float -> float | None |
Float.cos | float -> float | None |
Float.tan | float -> float | None |
Float.asin | float -> float | None |
Float.acos | float -> float | None |
Float.atan | float -> float | None |
Float.pow | float -> float -> float | None |
Float.atan2 | float -> float -> float | None |
Float.isNaN | float -> bool | None |
Float.isInfinity | float -> bool | None |
Float.isFinite | float -> bool | None |
Float.pi | float | None |
Float.tryToInt | float -> int option | None |
String additions
| Name | Signature | Host permissions |
|---|---|---|
String.compare | string -> string -> int | None |
String.length | string -> int | None |
String.isEmpty | string -> bool | None |
String.isWhiteSpace | string -> bool | None |
String.trim | string -> string | None |
String.trimStart | string -> string | None |
String.trimEnd | string -> string | None |
String.splitLines | string -> string list | None |
String.startsWith | string -> string -> bool | None |
String.contains | string -> string -> bool | None |
String.padLeft | int -> string -> string | None |
String.padRight | int -> string -> string | None |
String.repeat | int -> string -> string | None |
List additions
| Name | Signature | Host permissions |
|---|---|---|
List.isEmpty | 'a list -> bool | None |
List.forall | ('a -> bool) -> 'a list -> bool | None |
List.mapi | (int -> 'a -> 'b) -> 'a list -> 'b list | None |
List.indexed | 'a list -> ((int * 'a)) list | None |
List.init | int -> (int -> 'a) -> 'a list | None |
List.take | int -> 'a list -> 'a list | None |
List.skip | int -> 'a list -> 'a list | None |
List.takeWhile | ('a -> bool) -> 'a list -> 'a list | None |
List.skipWhile | ('a -> bool) -> 'a list -> 'a list | None |
List.partition | ('a -> bool) -> 'a list -> ('a list * 'a list) | None |
List.zip | 'a list -> 'b list -> (('a * 'b)) list | None |
List.unzip | (('a * 'b)) list -> ('a list * 'b list) | None |
List.chunkBySize | int -> 'a list -> 'a list list | None |
List.scan | ('d -> 'a -> 'd) -> 'd -> 'a list -> 'd list | None |
List.sortWith | ('a -> 'a -> int) -> 'a list -> 'a list | None |
List.sortBy | ('a -> 'c) -> 'a list -> 'a list | None |
List.distinctBy | ('a -> 'c) -> 'a list -> 'a list | None |
List.groupBy | ('a -> 'c) -> 'a list -> (('c * 'a list)) list | None |
List.countBy | ('a -> 'c) -> 'a list -> (('c * int)) list | None |
Map additions
| Name | Signature | Host permissions |
|---|---|---|
Map.keys | 'a map['c] -> 'c list | None |
Map.values | 'a map['c] -> 'a list | None |
Map.toList | 'a map['c] -> (('c * 'a)) list | None |
Map.exists | ('c -> 'a -> bool) -> 'a map['c] -> bool | None |
Map.forall | ('c -> 'a -> bool) -> 'a map['c] -> bool | None |
Map.update | 'c -> ('a option -> 'a option) -> 'a map['c] -> 'a map['c] | None |
Map.mergeWith | ('c -> 'a -> 'a -> 'a) -> 'a map['c] -> 'a map['c] -> 'a map['c] | None |
Option additions
| Name | Signature | Host permissions |
|---|---|---|
Option.bind | ('a -> 'b option) -> 'a option -> 'b option | None |
Option.flatten | 'a option option -> 'a option | None |
Option.filter | ('a -> bool) -> 'a option -> 'a option | None |
Option.orElse | 'a option -> 'a option -> 'a option | None |
Option.orElseWith | (unit -> 'a option) -> 'a option -> 'a option | None |
Option.map2 | ('a -> 'b -> 'd) -> 'a option -> 'b option -> 'd option | None |
Option.toList | 'a option -> 'a list | None |
Path additions
| Name | Signature | Host permissions |
|---|---|---|
Path.normalize | string -> string | None |
Path.isAbsolute | string -> bool | None |
Path.combine | string -> string -> string | None |
Path.fileName | string -> string | None |
Path.extension | string -> string option | None |
Path.fileNameWithoutExtension | string -> string | None |
Path.parent | string -> string option | None |
Path.relative | string -> string -> string option | None |
Glob additions
| Name | Signature | Host permissions |
|---|---|---|
Glob.isMatch | string -> string -> bool | None |
Glob.filter | string -> string list -> string list | None |
SemVer additions
| Name | Signature | Host permissions |
|---|---|---|
SemVer.tryParse | string -> ({ Build: string; Major: string; Minor: string; Patch: string; PreRelease: string }) option | None |
SemVer.format | { Build: string; Major: string; Minor: string; Patch: string; PreRelease: string } -> string | None |
SemVer.compare | string -> string -> int option | None |
Encoding additions
| Name | Signature | Host permissions |
|---|---|---|
Encoding.utf8Encode | string -> int list option | None |
Encoding.utf8Decode | int list -> string option | None |
Encoding.base64Encode | int list -> string option | None |
Encoding.base64Decode | string -> int list option | None |
Encoding.hexEncode | int list -> string option | None |
Encoding.hexDecode | string -> int list option | None |
Encoding.uriEncode | string -> string option | None |
Encoding.uriDecode | string -> string option | None |
Hash additions
| Name | Signature | Host permissions |
|---|---|---|
Hash.sha256 | string -> string option | None |
Hash.sha256Bytes | int list -> string option | None |
Process
Runtime supplies Process through default externs, without a package import. Execution requires Native; defaults and data types require no grants. Script task operations separately require Threading.
| Name | Type | Availability | Host permissions |
|---|---|---|---|
Process.defaults | ProcessOptions | Runtime value | None |
Process.exec | string -> string list -> ProcessOptions -> ProcessResult task | Runtime function | Native |
Http.defaults | HttpRequest | Runtime value | None |
Http.send | string -> string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.get | string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.head | string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.post | string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.put | string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.patch | string -> HttpRequest -> HttpResult task | Runtime function | Network |
Http.delete | string -> HttpRequest -> HttpResult task | Runtime function | Network |
ProcessOptions | Process configuration record | Runtime data type | None |
ProcessResult | Exited of { exitCode: int; stdout: string; stderr: string } / Failed of { message: string; stdout: string; stderr: string } | Runtime union | None |
FScript
| Name | Type | Availability | Host permissions |
|---|---|---|---|
FScript.defaults | FScriptOptions | Runtime value | None |
FScript.exec | string -> string list -> FScriptOptions -> FScriptResult task | Runtime function | Threading |
FScriptOptions | Root, permission, and timeout options | Runtime record | None |
FScriptResult | Completed of { value: string; exitCode: int } / Failed of { message: string } | Runtime union | None |