v0.4.4 (16 May 2026)
The hkj-test Module, PCollections Integration, and Type Class Enrichments
This release ships hkj-test, a new publishable module providing fluent AssertJ assertion helpers for every public Higher-Kinded-J type, validates and extends PCollections persistent-collection support across the HKT and optics infrastructure, enriches the type class hierarchy with Alternative.orElseAll(Iterable) and MonadZero.filter, makes ForState.zoom and ReaderPath.magnify optic-polymorphic, standardises the internal validation package, and refreshes the Tooling chapter to lead with the recommended build-plugin setup.
- hkj-test Module: New publishable module (
io.github.higher-kinded-j:hkj-test) with 19 user-facing assertion classes covering the discriminated unions (Either,Maybe,Try,Validated,Lazy), the Reader/Writer/State trio, the effect types (IO,VTask,VStream), every monad transformer, and theFree/EitherFalgebras. Published as a JPMS module (org.higherkindedj.test) so a single dependency declaration suffices; Java 25 with--enable-previewcanimport module org.higherkindedj.test;to bring every helper into scope. Backed by anAssertContract<S, A>contract-test framework holding the module at a 100% line+instruction coverage gate, plus a new/hkj-testClaude Code skill - hkj-test Coverage Extension: Seven further assertion classes promoted from
hkj-coretest sources into the published artifact: theList/OptionalKind/Stream/IdKind-narrowing wrappers (assertThatList,assertThatOptionalKind,assertThatStream,assertThatId) and theVTaskPath/VStreamPath/VTaskContextpath-and-context assertions - PCollections HKT Compatibility: Validates that PCollections persistent collections (
PVector,PStack) work through the existingListKind/ListMonad/ListTraverse/ListSelective/Alternativeinfrastructure viajava.util.Listcompatibility with no production code changes, backed by integration tests, jQwik property tests for the Functor/Monad/Foldable laws, JMH benchmarks, and a runnable example - PCollections Optics Generators: Seven
TraversableGeneratorplugins teaching@GenerateTraversalsand@GenerateFocusto navigate PCollections types (PVector,PStack,PSet,PSortedSet,PBag,PMapvalues,PSortedMapvalues); auto-discovered whenorg.pcollectionsis on the annotation-processor classpath. The generator ecosystem grows from 23 to 30 implementations - Traversals.forMapValuesCollecting: Map-shaped companion to
forIterableCollecting, with a bounded single-arg overload forjava.util.Mapsubtypes (PCollectionsPMap/PSortedMap, GuavaImmutableMap) and an unbounded two-arg overload for non-java.util.Maptypes (Eclipse Collections, Vavr);EachInstances.mapValuesEachCollectingmirrors both for the Focus DSL - Alternative.orElseAll(Iterable): Dynamically-sized counterpart to the existing varargs
orElseAlland analogue of Haskell'sasum/msum, folding an iterable of alternatives viaorElse.ListMonadandStreamMonadoverride it to avoid O(n^2) result copying and deeply-nestedStream.concatchains while preserving lazy evaluation - MonadZero.filter: New default
filter(Predicate, Kind)derived fromflatMap+of/zero, with allocation-freeListMonad/StreamMonadoverrides; the duplicated guard pattern is refactored out ofFor.when,ForState.when/zoom, and theForPathcomprehension builders to callfilterdirectly - Axes of Transformer Transformation:
ForState.zoomnow acceptsFocusPath,AffinePath(short-circuiting viaMonadZero.zero()when the focus is absent), andIsoin addition toLens;ReaderPathgains optic-awaremagnify(Getter)andmagnify(FocusPath)overloads alongside the existinglocal(Function)escape hatch. New chapter plus aMagnifyServiceLayerExampleand Tutorial 05 (Optic-Polymorphic Zoom and Magnify) - Validation package standardised: the
Operationenum gainsWIDEN/NARROW/OR_ELSE_ALL/FILTER,ValidationexposesKIND/FUNCTION/TRANSFORMER/COREstatic fields,FunctionValidatorgainsvalidateMap(44 Functor/Monad sites migrated), andKindValidator.narrowWithPatternis@Deprecated(forRemoval=true)for removal in 0.5.0 in favour of the newnarrowHolder
Documentation & Tutorial Improvements
- Build Plugins as the Documented Default: The Tooling chapter is reordered so Build Plugins leads as the recommended path and Manual Setup follows as the explicit fallback, with Previous/Next navigation rewired across the chapter to keep the sequence linear. The Spring Boot Quickstart gains an
hkj-bomoption (Gradle and Maven forms) so all HKJ module versions are declared once - Where to Start: New task-first landing page that asks "what are you trying to do?" before routing to the chapter-level decision trees, with five top-level branches (failure/absence, nested data, async/IO, sequencing, polymorphic code) plus a Combining Tools section covering the most common cross-axis combinations