F# Examples
F# aligned plain-text terminal table
Renders headers and rows as a column-aligned plain-text table with separator rules and no dependencies.
F# Base64 encode and strict decode
Encodes text to Base64 and decodes it back with validation for bad alphabets and invalid UTF-8.
F# field-level input validation errors
Validates name, email, and age fields and returns a map of field names to readable error messages.
F# build and parse URL query strings
Encodes key-value pairs into a URL query string and parses one back into a map with percent decoding.
F# JSON parsing with descriptive errors
Decodes JSON fields with explicit checks and returns readable error messages instead of raw exceptions.
F# bounded worker pool collecting results
Runs jobs on a fixed number of workers and returns every result or exception in the original job order.
F# timed HTTP GET that parses JSON
Performs an HTTP GET with a five second timeout, checks the status, and parses the body as JSON.
F# typed environment config with validation
Reads typed settings from environment variables with defaults and fails fast on an invalid port value.
F# token bucket rate limiter for bursts
A synchronous token bucket that allows short bursts while enforcing an average rate of tokens per second.
F# bounded LRU cache with recency tracking
A bounded LRU cache built on an immutable map that evicts the least recently used key when it exceeds capacity.
F# multi-key record sort with null ordering
Stable multi-key sort for records that puts null strings first and then compares by age as a tiebreaker.
F# chunk a sequence into fixed-size lists
Splits any sequence into lists of at most N items, keeping the final partial batch and rejecting invalid sizes.
F# stream a text file line by line lazily
Returns a lazy sequence that streams a text file one line at a time without loading the whole file into memory.
F# deep clone and recursive merge for trees
Deep-copies an immutable JSON-like tree and merges two trees recursively, with the override winning on leaves.
F# retry with capped exponential backoff and jitter
Runs an operation up to N times with capped exponential backoff plus random jitter so retries do not stampede.