Repository navigation
Releases: scytrowski/mat
Release list
v1.2.1
mat v1.2.1
This release fixes materialization for same-named singleton variants in sealed ADTs.
Highlights
- Single-variant sealed ADTs can now materialize when their case object shares the trait's name, including through nested branches.
- Regression coverage verifies ambiguous multi-variant parents remain unsupported while the individual singleton branches materialize.
- The fix and expanded tests pass on Scala 3.8.4, 3.9.0 and 3.10.0.
Full Changelog: v1.2.0...v1.2.1
v1.2.0
mat v1.2.0
This release adds support for Scala 3.10.x to mat.
Highlights
- The library is now cross-built, tested and packaged for Scala 3.8.x, 3.9.x and 3.10.x.
- Releases continue to publish a single shared
_3artifact, built with Scala 3.8.4. - CI validation passed for the updated Scala version matrix.
Cross-building
Scala 3.10.x projects can use the existing %% dependency declaration to select the shared Scala 3 artifact.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
mat v1.1.0
This release simplifies custom materialization by unifying it around the Materialize[A] API.
Highlights
- Explicit materialization is now provided through
Materialize.fromValue. - Explicit
Materialize[A]evidence takes precedence over built-in derivation at every level, including nested products, tuples, intersections and sums. - Precise output types remain available through
Materialize.Aux[A, O]. - Documentation now includes the explicit materialization API and migration guidance.
- Compile-time benchmark execution has been streamlined.
Breaking changes
- Removed the redundant
CustomMaterialize[A]API.
Migration
Replace custom materialization:
given CustomMaterialize[SomeType]:
type Out = SomeType
def apply(): SomeType = valuewith:
given Materialize[SomeType] =
Materialize.fromValue(value)For a more precise output type:
given Materialize.Aux[Int, 5] =
Materialize.fromValue[Int, 5](5)Materialize.fromValue accepts its argument by name, so the expression is evaluated each time the materialized evidence is applied.
v1.0.0
mat 1.0.0
The first stable release of mat, a Scala 3 macro library for compile-time materialization of type-level descriptions into concrete values.
Highlights
- Macro-based derivation of
Materialize[A]. - Precise result types preserved for
materialize[A]andmaterializeOpt[A]. - Support for:
- literal types,
- tuples and named tuples,
- case-class products,
- unions and intersections,
- nested and parameterized sealed-trait ADTs,
- enums and GADT-like definitions.
CustomMaterialize[A]for application-specific materialization rules.- Explicit
Materialize[A]evidence throughMaterialize.fromValue. materializeOpt[A]for safe materialization withNoneon unsupported types.- Context-bound support for APIs requiring materializable types.
- Detection of ambiguous, recursive and unsupported derivations.
Diagnostics
Compilation errors now include detailed context:
- unsupported tuple elements,
- unsupported product fields,
- ambiguous unions,
- rejected ADT variants,
- recursive branches,
- incompatible intersections,
- unsupported parameterized variants.
Cross-building
The library supports Scala 3.8.x and 3.9.x.
Both versions are tested in CI. Since they share the _3 artifact suffix, releases publish a single artifact built with Scala 3.8.4.
Performance and tooling
- Added derivation caching for repeated nested types.
- Optimized tuple derivation.
- Added compile-time benchmarks for tuples, products and unions.
- Release benchmarks run on Scala 3.8.4 and detect significant regressions.
- Added statement and branch coverage thresholds to CI.
Documentation
- Added comprehensive Scaladoc.
- Scaladoc is generated during releases with external assets vendored locally.
- Versioned documentation is stored on the
scaladocbranch. - Benchmark reports are retained on the
benchmarksbranch.
Migration from 0.5.0
SingletonSumhas been removed. Singleton-sum derivation is now handled directly by the materialization macro.- Materialization is now derived through quoted macros instead of the previous implicit-only implementation.
- Explicit
Materialize[A]evidence takes precedence overCustomMaterialize[A], which in turn takes precedence over built-in derivation. - Diagnostic messages are more precise and may differ from previous versions.
- Recursive and ambiguous derivations that were previously unsupported are now detected and reported consistently.
Limitations
Materialization is intentionally conservative. It requires enough compile-time information to produce one unambiguous value. Abstract types, Any, Nothing, recursive structures, ambiguous unions and sums with multiple candidates are not materialized.
Macro expansion and deeply nested types may increase compilation time. No runtime reflection is used.
v0.5.0
v0.4.0
v0.3.0
- Bump Scala to
3.8.2 - Change project package to
me.cytrowski
v0.2.0
- Allow to provide custom materialization implementations via
CustomMaterialize - Add tests for materialization of named tuples and enums