Developer Guide
This guide goes deeper than Getting Started. Each section covers one type in full: design rationale, every combinator, composition with other types, and pitfalls to avoid.
New to dmx-fun? Start with the Introduction for a mental model of the library and a first taste of composition before diving into individual types.
Which type should I use?
Type overview
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 guarantee.
Accumulator<E, A> Tracing A value paired with a side-channel accumulation (log, metrics, audit trail). The functional alternative to mutable shared state for cross-cutting concerns.
Checked interfaces Interop Checked variants of Function, Supplier, Consumer, Runnable, plus TriFunction/QuadFunction.
Cross-type composition
The types interoperate through conversion methods. The Combining Types page covers the full conversion matrix and composition patterns such as railway-oriented pipelines and parallel validation.
Modules
Optional modules extend the library with integrations for popular frameworks and libraries. Each module is an independent dependency — add only what you need.
Jackson integration JSON Serializers and deserializers for all dmx-fun types via the optional fun-jackson module.
AssertJ integration Testing Fluent AssertJ custom assertions for Option, Result, Try, Validated, and Tuple types.
Spring integration Spring TxResult and TxTry: programmatic transaction support that rolls back when Result.isError() or Try.isFailure(), without relying on exceptions.
Contributing & Maintainer
Documentation for working on the library itself: local setup, CI pipelines, release process, and conventions for adding new modules.
Contributing Contributors Prerequisites, local build and test setup, code conventions, and how to open a PR.
CI/CD Pipelines Maintainers Reference for all six GitHub Actions workflows: triggers, secrets, local equivalents, and gotchas.
Release Process Maintainers Step-by-step guide for cutting a stable release: version bump, publish, tag, post-release SNAPSHOT.
Adding a New Module Maintainers Conventions and checklist for adding a new optional integration module.