v0.4.0 (22 March 2026)

v0.4.0 on GitHub

SPI-Aware Path Widening, Expanded Plugin Ecosystem, and Focus DSL Restructure

This release introduces SPI-aware path widening for the Focus DSL, allowing automatic AffinePath and TraversalPath generation based on container cardinality, expands the TraversableGenerator plugin ecosystem to 23 generators across 6 library families, adds Traversal.asFold() for read-only monoidal aggregation, restructures the Focus DSL documentation into dedicated pages, and delivers comprehensive test coverage and Javadoc quality improvements across processor modules.

  • SPI-Aware Path Widening: Automatic path type inference based on container cardinality: ZERO_OR_ONE produces AffinePath, ZERO_OR_MORE produces TraversalPath, eliminating manual .each() and .some() calls in generated navigators
  • Cardinality-Based Widening: TraversableGenerator SPI extended with Cardinality enum, priority system (PRIORITY_FALLBACK, PRIORITY_DEFAULT, PRIORITY_OVERRIDE), widenCollections opt-in attribute, and wildcard type resolution for ? extends T, ? super T, and bare ?
  • Nested Container Widening: Compound types like Optional<List<String>> resolve correctly through recursive cardinality analysis, with navigator field collision detection
  • Generator Plugin Ecosystem: 23 TraversableGenerator implementations across 6 library families: base JDK (Array, List, Set, Optional, MapValue), Apache Commons Collections4 (HashBag, UnmodifiableList), Eclipse Collections (ImmutableBag, MutableBag, ImmutableList, MutableList, ImmutableSet, MutableSet, ImmutableSortedSet, MutableSortedSet), Google Guava (ImmutableList, ImmutableSet), Vavr (List, Set), and HKJ native (Either, Maybe, Try, Validated)
  • Traversal.asFold(): Conversion from any Traversal to a read-only Fold for monoidal aggregation, existence checks, and length counting via new ConstForFold applicative functor
  • AffinePath: New AffinePath<S, A> for zero-or-one navigation in Focus DSL, with Affine optic interface supporting getOrModify and set
  • Portfolio Risk Analysis: Capstone example demonstrating container navigation, SPI widening, and nested optics composition
  • Focus DSL documentation restructured into dedicated pages: Containers, Navigation, Effects, and Reference
  • Tutorial 19: Navigator Generation: 7 exercises on annotation-driven navigator code generation
  • Tutorial 20: Container Navigation: 4 exercises on SPI-aware container type navigation
  • Automated SPI service declarations via Avaje SPI processor for plugin discovery

Previous: v0.4.1 Next: v0.3.0 to v0.3.7