ex_stdlib
Elixir-inspired standard library modules implemented in Erlang.
Overview
This project provides Erlang implementations of useful modules from Elixir's standard library, bringing modern functional programming patterns and concurrent programming abstractions to Erlang.
Modules
Core Modules
agent- Simple state management abstraction around GenServertask- Asynchronous task execution with async/await patternsregistry- Local, decentralized key-value process storage for service discovery and pub-subprocess- Convenient process management utilities and wrapperskeyword- Keyword list operations and utilities inspired by Elixiruri- URI parsing, manipulation, and encoding/decoding utilitiesbase- Base16, Base32, and Base64 encoding/decoding with multiple variantspath- Cross-platform file system path manipulation and utilitiesfunction- Function utilities including composition, currying, and memoizationdynamic_supervisor- Dynamic supervisor optimized for millions of children
Features
- Type-safe: Complete
-specannotations for all functions - Well-documented: Comprehensive EDoc documentation with examples
- Battle-tested: Extensive test suites covering edge cases and error conditions
- Production-ready: Follows OTP best practices and Erlang coding conventions
Quick Start
Build
rebar3 compileRun Tests
rebar3 eunitExamples
See the examples/ directory for usage examples, or start an Erlang shell:
erl -pa _build/default/lib/ex_stdlib/ebin% Agent example - simple state management
{ok, Agent} = agent:start_link(fun() -> 0 end).
agent:update(Agent, fun(State) -> State + 1 end).
1 = agent:get(Agent, fun(State) -> State end).
% Task example - async/await
Task = task:async(fun() -> expensive_computation() end).
OtherResult = do_other_work().
TaskResult = task:await(Task).Project Structure
ex_stdlib/
├── src/ # Core library modules
├── test/ # EUnit test suites
├── examples/ # Usage examples
└── _build/ # Compiled artifactsDocumentation
For detailed API documentation, see individual module documentation in the source files or generate with:
rebar3 edoc