Skip to content

Commit 404c265

Browse files
committed
chore: release fp-library v0.16.0 / fp-macros v0.7.0
1 parent 189eb9e commit 404c265

8 files changed

Lines changed: 74 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Add `fp-library` to your `Cargo.toml`:
9292

9393
```toml
9494
[dependencies]
95-
fp-library = "0.15"
95+
fp-library = "0.16"
9696
```
9797

9898
## Features
@@ -113,10 +113,10 @@ To enable features:
113113
```toml
114114
[dependencies]
115115
# Single feature
116-
fp-library = { version = "0.15", features = ["rayon"] }
116+
fp-library = { version = "0.16", features = ["rayon"] }
117117

118118
# Multiple features
119-
fp-library = { version = "0.15", features = ["rayon", "serde"] }
119+
fp-library = { version = "0.16", features = ["rayon", "serde"] }
120120
```
121121

122122
## How it Works

fp-library/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.16.0] - 2026-04-14
11+
12+
### Added
13+
14+
- **Ref trait hierarchy**: `RefFunctor`, `RefSemimonad`, `RefApplicative`, `RefMonad`, `RefFoldable`, `RefFilterable`, `RefTraversable`, `RefWitherable`, `RefBifunctor`, `RefBifoldable`, `RefBitraversable`, `RefCompactable`, `RefAlt`, `RefApplyFirst`, `RefApplySecond`, and all corresponding `SendRef` and `ParRef` variants. These traits operate on borrowed containers (`&fa`) with closures that take references (`Fn(&A) -> B`).
15+
- **Brand inference system**: `InferableBrand` traits auto-generated by `trait_kind!`/`impl_kind!` provide reverse mapping from concrete types to brands. The compiler infers brands automatically for unambiguous types (Option, Vec, etc.).
16+
- **Val/Ref dispatch**: 19 dispatch modules in `dispatch/` unify by-value and by-reference trait methods behind a single function. The closure's argument type (owned vs borrowed) selects the appropriate trait method at compile time with zero runtime cost.
17+
- **Inference wrapper functions**: 38 free functions (e.g., `map`, `bind`, `fold_left`, `traverse`, `contramap`) that combine brand inference with Val/Ref dispatch. Users write `map(|x: i32| x + 1, Some(5))` with no turbofish.
18+
- **`ContravariantDispatch`**: Dispatch module for `contramap` following the same pattern as other dispatch modules (Val-only, no Ref variant).
19+
- **Inferred mode for `m_do!`/`a_do!`**: `m_do!({ ... })` and `a_do!({ ... })` (without brand parameter) infer the brand from the first monadic expression.
20+
- **`ref` qualifier for `m_do!`/`a_do!`**: `m_do!(ref Brand { ... })` dispatches to by-reference trait methods.
21+
- **`FoldableWithIndex` mutual derivation**: `FoldableWithIndex` and `FnBrand`-parameterized foldable operations support mutual derivation with the base `Foldable` trait.
22+
23+
### Changed
24+
25+
- **Dispatch modules restructured**: Inference wrappers moved from `functions/*.rs` into `dispatch/*.rs` modules. Each dispatch module now contains the dispatch trait, Val/Ref impls, inference wrapper, and `mod explicit` submodule. `functions.rs` is now a facade that re-exports from `dispatch/`.
26+
- **`explicit::contramap` signature**: Now takes 5 type parameters (`Brand, A, B, FA, Marker`) instead of 3 (`Brand, A, B`) due to the dispatch pattern. Call sites using turbofish must update from `<Brand, _, _>` to `<Brand, _, _, _, _>`.
27+
- **Ref traits borrow containers**: Ref trait methods now take `&fa` (borrowed container) instead of owned containers. This is a breaking change for all Ref trait implementations and call sites.
28+
- **`#[allow]` to `#[expect]`**: All lint suppression attributes converted from `#[allow]` to `#[expect]` with reason strings.
29+
- **`RefFunctor`/`SendRefFunctor` closures**: Changed from `FnOnce` to `Fn` for consistency with the rest of the trait hierarchy.
30+
31+
### Removed
32+
33+
- **`functions/*.rs` source files**: Replaced by dispatch modules. The `functions/` directory no longer contains source files; `functions.rs` re-exports from `dispatch/`.
34+
- **`LiftRefFn`, `RefEndofunction`, `coerce_ref_fn`**: Removed unused ref function lifting utilities.
35+
- **Non-dispatch free functions from public API**: By-value and by-ref free functions in `classes/` that are superseded by dispatch versions are excluded from `functions` re-exports.
36+
37+
### Fixed
38+
39+
- **`ref_fold_left_with_index` argument order**: Aligned with Val variant and PureScript convention.
40+
1041
## [0.15.0] - 2026-04-02
1142

1243
### Added

fp-library/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fp-library"
3-
version = "0.15.0"
3+
version = "0.16.0"
44
edition = "2024"
55
description = "A functional programming library for Rust featuring your favourite higher-kinded types and type classes."
66
readme = "../README.md"
@@ -18,7 +18,7 @@ harness = false
1818
name = "benchmarks"
1919

2020
[dependencies]
21-
fp-macros = { path = "../fp-macros", version = "0.6" }
21+
fp-macros = { path = "../fp-macros", version = "0.7" }
2222
rayon = { version = "1.11", optional = true }
2323
serde = { version = "1.0", features = ["derive"], optional = true }
2424
stacker = { version = "0.1", optional = true }

fp-library/docs/release-process.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,28 @@ git checkout -b release/fp-library-vX.Y.Z
6666
1. Rename the `[Unreleased]` section to the new version number and date (e.g., `[0.3.0] - 2026-01-16`).
6767
2. Create a new empty `[Unreleased]` section at the top.
6868
69-
### 5. Update Cargo.toml
69+
### 5. Update Versions
70+
71+
Search **all** files listed below for version references and update
72+
them. Version strings may appear in multiple formats (short `"0.6"`,
73+
long `{ version = "0.6", ... }`, prose, badges, etc.). Use grep to
74+
find all occurrences:
75+
76+
```bash
77+
grep -rn '0\.OLD_MINOR' fp-macros/Cargo.toml fp-macros/README.md \
78+
fp-library/Cargo.toml README.md
79+
```
7080
7181
#### fp-macros (if changed)
7282
73-
1. Update `version` in `fp-macros/Cargo.toml` and in `fp-macros/README.md`.
83+
- `fp-macros/Cargo.toml`: `version` field.
84+
- `fp-macros/README.md`: dependency snippet in the Installation section.
7485
7586
#### fp-library
7687
77-
1. Update `version` in `fp-library/Cargo.toml` and in `README.md`.
78-
2. If `fp-macros` was updated, ensure the `fp-macros` dependency in `fp-library/Cargo.toml` matches the new version.
88+
- `fp-library/Cargo.toml`: `version` field, and `fp-macros` dependency
89+
version (if fp-macros was updated).
90+
- `README.md` (repo root): all dependency snippets (there are multiple).
7991
8092
### 6. Verification
8193

fp-macros/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.7.0] - 2026-04-14
11+
12+
### Added
13+
14+
- **Dispatch-aware HM signature generation**: `#[document_module]` analyzes dispatch traits (Pass 1b) and generates Hindley-Milner type signatures for inference wrapper functions by building synthetic signatures that replace dispatch machinery with semantic equivalents. Produces signatures like `forall Brand A B. Functor Brand => (A -> B, Brand A) -> Brand B`.
15+
- **`#[document_signature]` manual override**: `#[document_signature("forall A B. (A -> B) -> A -> B")]` emits the provided string directly, bypassing the generation pipeline.
16+
- **`InferableBrand` trait generation**: `trait_kind!` generates `InferableBrand_*` traits alongside `Kind_*` traits. `impl_kind!` auto-generates `InferableBrand` impls for concrete types.
17+
- **Inferred mode for `m_do!`/`a_do!`**: `m_do!({ ... })` infers the brand from the first monadic expression instead of requiring an explicit brand parameter.
18+
- **`ref` qualifier for `m_do!`/`a_do!`**: `m_do!(ref Brand { ... })` generates code that dispatches to by-reference trait methods.
19+
- **Exclusion support in `generate_function_re_exports!`**: `exclude { "module::function" }` syntax to suppress re-exports of functions superseded by dispatch versions.
20+
- **Insta snapshot regression tests**: 19 per-file tests covering all 38 dispatch inference wrapper HM signatures, plus 14 edge case tests for unusual inputs and graceful fallback behavior.
21+
22+
### Changed
23+
24+
- **`#[document_signature]` attribute parsing**: Now accepts an optional string literal argument (previously rejected all arguments).
25+
- **Dispatch analysis uses direct sources**: Container param mapping uses positional alignment from trait definition (not heuristic ident scanning). Brand param derived from trait definition's Kind\_\* bound (not Val impl where clause). Type param ordering follows trait definition order (not alphabetical sort). Inner Apply! macros in self-type elements resolved via `apply_worker`.
26+
- **`m_do!`/`a_do!` codegen**: Updated to use `explicit::bind`/`explicit::map` paths instead of `bind_explicit`/`map_explicit`.
27+
1028
## [0.6.0] - 2026-03-14
1129

1230
### Added

fp-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fp-macros"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
edition = "2024"
55
description = "Procedural macros for generating and working with Higher-Kinded Type (HKT) traits in the fp-library crate."
66
repository = "https://github.com/nothingnesses/rust-fp-library"

fp-macros/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Add this to your `Cargo.toml`:
1414

1515
```toml
1616
[dependencies]
17-
fp-macros = "0.6"
17+
fp-macros = "0.7"
1818
```
1919

2020
> **Note:** If you are using [`fp-library`](https://crates.io/crates/fp-library), these macros are already re-exported at the crate root. You only need to add this dependency if you are using the macros independently.

0 commit comments

Comments
 (0)