Standard library
These are the built-in modules for the Erlang target: lists, HTTP, HTML, databases, processes, AI sessions, and more. Click a name for signatures and docs.
JavaScript projects use selm's client platform instead of this BEAM stdlib: Browser, Html, Http, Json.Decode, Random, and related client packages, built into the compiler with nothing to install. On the BEAM, modules are grouped by job: core types, bytes, JSON, database and cache (including column types), auth, HTML and web, AI, processes, config and IO, and testing.
New to form validation? Start with the Forms guide, then open Changeset and Changeset.Validate below.
Core
ArrayFast immutable arrays.BasicsCore helpers shared across modules.BitwiseLibrary for [bitwise operations](https://en.CharFunctions for working with characters.DateA calendar day without a time of day or time zone.DebugThis module is useful while developing.DictA dictionary mapping unique keys to values.DurationElapsed time as an opaque millisecond count.ListYou can create aListwith the[1,2,3]syntax, so lists are used all over the place.MaybeThis library fills a bunch of important niches.NaiveDateTimeWall-clock date and time without a time zone.ParserParsers for strings: tokens, numbers, sequences, and loops.Parser.AdvancedContext-aware parsers with custom problem types.RandomPseudo-random generators for the BEAM target.ResultAResultis the result of a computation that may fail.SetA set of unique values.StringA built-in representation for efficient string manipulation.TaskWork that runs outsideupdate.TimeWall-clock time for the BEAM target.Time.FormatStrftime-style formatting forTime.Posix.TupleSelm has built-in syntax for tuples, so you can define 2D points like this:UuidUniversally Unique Identifiers without a database transaction.
Bytes
JSON
JsonOpaque JSON values for database columns and Encode/Decode.Json.DecodeDecodeJson.Value/ JSON text into Selm values.Json.Decode.DynamicWalk unknown or heterogeneous JSON without a full typedDecodertree.Json.Decode.Pipeline# Json.Json.EncodeBuildJson.Valuepayloads for inserts and HTTP-adjacent JSON.
Validation
Database
Database.Float3232-bit floating-point column type.Database.Float6464-bit floating-point column type.Database.FloatXArbitrary-precision numeric column type (SQL numeric).Database.Int1616-bit signed integer column type.Database.Int3232-bit signed integer column type.Database.Int6464-bit signed integer column type.Database.Int88-bit signed integer column type.Database.IntXArbitrary-precision integer column type (SQL numeric).Database.MigrationOrdered schema-evolution plans (rename, type change, raw SQL).Database.ReducerSQL aggregates overRowsqueries.Database.RepoA supervised connection pool for a SQL or cache store.Database.RowsBuild and run queries over table rows.Database.SecurityPolicies that decide which rows a token may touch.Database.SequenceDatabase sequences for monotonic primary keys and similar identifiers.Database.TableDeclare tables, indexes, foreign keys, and row-level security.Database.TransactionWork that commits or rolls back together on one checked-out [Database.Repo] connection.Database.UInt1616-bit unsigned integer column type.Database.UInt3232-bit unsigned integer column type.Database.UInt6464-bit unsigned integer column type.Database.UInt88-bit unsigned integer column type.Database.UuidWork with Universally Unique Identifiers inside aTransaction.
Cache
Auth
Auth.CsrfDouble-submit CSRF cookies for browser apps.Auth.OAuthAuthorization Code + PKCE OAuth client.Auth.PasswordResetPassword-reset tokens.Auth.RateLimitFixed-window rate limiting on a cache Repo (ETS or Valkey).Auth.SessionSigned cookie sessions and opaque session-id cookie helpers.HashContent digests and HMAC for webhooks, ETags, and signed payloads.JwtJSON Web Tokens for HTTP APIs.PasswordOpaque password hashes.
HTML & web
CookiesRead and write cookie jars, and encodeSet-Cookieheader values.EmailEmail sending and address-verification tokens for auth flows.Email.MjmlMJML-shaped email layout trees.Email.Mjml.AttributesAttributes forEmail.Mjmllayout nodes.HtmlHTML element trees for BEAM SSR and shared views.Html.AttributesHTML attributes for server-rendered elements.Html.EventsEvent attributes for shared TEA views.OpenGraphOpen Graph and Twitter Card meta tags for HTML documents.ReqOutbound HTTP for the BEAM, in the spirit of Elixir's [Req](https://hexdocs.RssRSS 2.ServerHTTP servers on the BEAM.Server.MiddlewareComposableRequest -> Responsewrappers forhandle.Server.RouteParse an HTTP method and path into a typed route value.SocketMount typed channels on a websocket path.UrlAbsolute URLs: protocol, host, path, query, and fragment.Url.BuilderBuild absolute, relative, and cross-origin URLs with query parameters.Url.ParserTurn a URL path into a typed value.Url.Parser.InternalUrl.Parser.QueryParse query-string parameters.
AI
Processes
ActorBuild and start a process that handles one message at a time.ChannelTyped realtime rooms shared by the server and the browser.ClusterStatic BEAM cluster formation (libcluster-shaped, no Hex dep).DeviceAn AtomVM program.ErpcCall functions on another BEAM node (OTPerpc).JobsDurable background jobs for BEAM apps (Oban-shaped).NodeConnect and inspect BEAM nodes.PlatformA BEAM program: one process owns the model and handles one message at a time (init/update/subscriptions, without a view).Platform.CmdCommands a program performs afterinitorupdate.Platform.SubSubscriptions a program re-reads after every update.PortOpen an Erlang port from a program.ProcessNames and subjects for addressing a running process.PubSubPush a channeldownvalue from outside a connected socket.StreamUploadStream chunked uploads over a typed channel.SupervisionDescribe a child that a supervisor starts and restarts.SupervisorStart a tree of supervised processes.
Config & IO
CsvFast CSV parsing for the BEAM (NimbleCSV-shaped).EnvProcess environment variables for the BEAM target.Env.DecodeDecode process environment variables into Selm values.Env.Decode.Pipeline# Env.FileFilesystem helpers for the BEAM target.LoggerLeveled print-debugging.MultipartParsemultipart/form-datarequest bodies (browser form uploads).PathFilesystem path string helpers for the BEAM target.StreamComposable lazy enumerables for the BEAM target.
Observability
OpenTelemetryTraces and metrics for BEAM apps (OTLP/HTTP JSON export).OpsOps surface: Prometheus scrape plus an Oban-style jobs dashboard.Ops.LiveLive Ops dashboard channel.Ops.PluginMountable Ops live dashboard: Telemetry fan-out,/_ops/socket, SPA shell.TelemetryIn-process event bus for BEAM apps (Elixir Telemetry–shaped, no Hex dep).
Testing
Other
Not available on the BEAM
Some Elm packages are browser-only: Browser, Html.Events, Http, and Browser.Navigation stay on the JavaScript target. BEAM apps use selm's Random, Url.Builder, Bytes, and File stdlib; the client platform keeps Elm's versions of those modules.
Worked dice example for both sides: examples/10_random (SPA Random.generate as a Cmd, server Random.generate / Random.step).
On the BEAM you still have Platform, Cmd, Sub, Task, Url, and Url.Parser. Outbound HTTP uses Req (Elixir Req-style); inbound servers use Server. File.read / File.write are filesystem tasks (not the browser picker); dual-target pin: fixtures/file_dual. Time.every delivers Posix; named zones use Time.getZone (not the client Time.here / Time.utc API). Dual-target pin: fixtures/time_dual. BEAM Process is Subject / call / listen (not client Id / spawn / kill); dual-target pin: fixtures/process_dual. JSON responses usually go through Server.json.