Developer Guide
Deep reference for every type in dmx-fun: design rationale, every combinator, composition patterns, and pitfalls to avoid.
Which type should I use?
Core types
Option<T> Nullability A value that may or may not be present. The null-safe alternative.
Result<V, E> Error handling Either a success value or a typed error. Models domain failures explicitly.
Try<V> Exception handling Wraps a computation that may throw. Turns exceptions into values.
Validated<E, A> Validation Like Result but accumulates multiple errors instead of failing fast.
Either<L, R> Disjoint union A neutral disjoint union with no success/failure semantics.
Lazy<T> Deferred computation A value computed at most once, on first access. Thread-safe memoization.
Tuple2/3/4 Product types Typed heterogeneous tuples. Named fields without a dedicated class.
NonEmptyList<T> Collections A list guaranteed to have at least one element at compile time.
NonEmptyMap<K,V> Collections A map guaranteed to have at least one entry at compile time. Insertion order preserved.
NonEmptySet<T> Collections A set guaranteed to have at least one element at compile time. No duplicates, insertion order preserved.
Guard<T> Validation A composable, named predicate that produces a Validated result — the reusable building block for validation pipelines.
Resource<T> Resource management A composable managed resource: acquire, use, and release with a guaranteed cleanup.
Accumulator<E,A> Tracing A value paired with a side-channel accumulation (log, metrics, audit trail). The functional alternative to mutable shared state.
Checked interfaces Interop Checked variants of Function, Supplier, Consumer, Runnable, plus TriFunction/QuadFunction.
Integration modules
Optional artifacts — add only what you need. Each module declares its peer dependency
as compileOnly so it never pulls in transitive dependencies unexpectedly.
Jackson JSON Serializers and deserializers for all dmx-fun types via the optional fun-jackson module.
AssertJ Testing Fluent AssertJ custom assertions for Option, Result, Try, Validated, and Tuple types.
Spring Spring TxResult and TxTry: programmatic transaction support that rolls back when Result.isError() or Try.isFailure(), without relying on exceptions.
Quarkus Quarkus TxResult and TxTry: CDI transaction support that rolls back when Result.isError() or Try.isFailure(). Declarative @TransactionalResult and @TransactionalTry via a CDI interceptor.
Resilience4J Resilience Adapters for Retry, CircuitBreaker, RateLimiter, and Bulkhead that return Try or Result instead of throwing exceptions.
Micrometer Observability Automatic counters, timers, and failure metrics for Try and Result executions via DmxMicrometer.
Micrometer Tracing Observability Automatic distributed tracing spans for Try and Result executions via DmxTracing.
Micrometer Observation Observability Metrics and distributed tracing spans for Try and Result executions — both signals from a single DmxObservation call.
Jakarta Validation Validation DmxValidator bridges Jakarta Bean Validation with Validated<NonEmptyList<E>, A> so all constraint violations accumulate without throwing ConstraintViolationException.
Jakarta JSON-B + JAXB Serialization JsonbAdapter and XmlAdapter implementations for all dmx-fun types via the optional fun-jakarta-jaxb module.
HTTP Client HTTP Wraps java.net.http.HttpClient so every call returns Result<T, HttpError> with typed variants for 4xx, 5xx, timeouts, and network failures.
Contributing & Maintainers
Prerequisites, local build, code conventions, and how to open a PR.
All six GitHub Actions workflows: triggers, secrets, local equivalents.
Step-by-step guide for cutting a stable release.
Conventions and checklist for adding a new optional integration module.