NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
crates.io
crates.io, #3188 most downloaded on crates.io
Frunk provides developers with a number of functional programming tools like HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid, Semigroup and friends.
Latest stable
0.5.0
Last release 4 months ago
04 Jul 2026
Ships fairly regularly
a new release about every 9 months
Most releases are documented
notes for 30 of 50 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
50 releases Β· first in 2016
Drag across the ruler to compare, or tap a release to open it.
Please see the changelog for details
Please see the changelog for details
Please see the changelog for details
Generic support for enum representations (https://github.com/lloydmeta/frunk/pull/252)Your coding agent can read these notes before it upgrades. Set up the MCP server β
Please see the changelog for details
Please see the changelog for details
Please see the changelog for details
Please see the changelog for details
Please see the changelog for details
Much thanks to the efforts of @CobaltCause .
See changelog for details.
Much thanks to the efforts of @CobaltCause.
proc-macro-hack machinery (proc-macros-impl) (https://github.com/lloydmeta/frunk/pull/214)Lots of good stuff thanks to team work from a number of contributors (incl steffahn , kpp , agluszak , rosefromthedead , and BGR360 )
Lots of good stuff thanks to team work from a number of contributors (incl steffahn, kpp, agluszak, rosefromthedead, and BGR360)
From the Changelog
Hcons::sculpt (https://github.com/lloydmeta/frunk/pull/194)extract to get value out of 1-type coproduct (https://github.com/lloydmeta/frunk/pull/201)Coproduct::map (https://github.com/lloydmeta/frunk/pull/204)[Breaking change] Rename Hlist! type macro to HList!
Lots of good stuff thanks to team work from a number of contributors (incl @mbrobbel, @ImmemorConsultrixContrarie , @ExpHP)
From the Changelog
Hlist! type macro to HList! (#132)HList.length() (#125)HFoldRightable rework: now HFoldRightable::foldr does not differ from HFoldLeftable::foldl in calling, like std::iter::DoubleEndedIterator::rfold does not differ from std::iter::Iterator::fold. Note: though foldr behavior wasn't changed, all old foldr calls would either stop compiling or produce wrong results (#171)Hlist! type macro to HList! (https://github.com/lloydmeta/frunk/issues/132)HList.length() (https://github.com/lloydmeta/frunk/issues/125)HFoldRightable rework: now HFoldRightable::foldr does not differ from HFoldLeftable::foldl in calling, like std::iter::DoubleEndedIterator::rfold does not differ from std::iter::Iterator::fold. Note: though foldr behavior wasn't changed, all old foldr calls would either stop compiling or produce wrong results (https://github.com/lloydmeta/frunk/issues/171)Allow folding hlist with a single Poly
Add support for deriving LabelledGeneric on enums
Note: this is a breaking change, see the PR for details
Box, Option, Vec and more.Added ToMut trait, which allows borrowing mutably from a Coproduct or HList.
ToMut trait, which allows borrowing mutably from a Coproduct or HList.#[derive(LabelledGeneric)] on tuple structsPath model and PathTraverser trait, which allows for composable lens-like-usage$crate::Adds support for transmogrifying data of different types
Adds support for transmogrifying data of different types
#[macro_use]
extern crate frunk_core;
use frunk::labelled::Transmogrifier;
#[derive(LabelledGeneric)]
struct InternalPhoneNumber {
emergency: Option<usize>,
main: usize,
secondary: Option<usize>,
}
#[derive(LabelledGeneric)]
struct InternalAddress<'a> {
is_whitelisted: bool,
name: &'a str,
phone: InternalPhoneNumber,
}
#[derive(LabelledGeneric)]
struct InternalUser<'a> {
name: &'a str,
age: usize,
address: InternalAddress<'a>,
is_banned: bool,
}
#[derive(LabelledGeneric, PartialEq, Debug)]
struct ExternalPhoneNumber {
main: usize,
}
#[derive(LabelledGeneric, PartialEq, Debug)]
struct ExternalAddress<'a> {
name: &'a str,
phone: ExternalPhoneNumber,
}
#[derive(LabelledGeneric, PartialEq, Debug)]
struct ExternalUser<'a> {
age: usize,
address: ExternalAddress<'a>,
name: &'a str,
}
let internal_user = InternalUser {
name: "John",
age: 10,
address: InternalAddress {
is_whitelisted: true,
name: "somewhere out there",
phone: InternalPhoneNumber {
main: 1234,
secondary: None,
emergency: Some(5678),
},
},
is_banned: true,
};
/// Boilerplate-free conversion of a top-level InternalUser into an
/// ExternalUser, taking care of subfield conversions as well.
let external_user: ExternalUser = internal_user.transmogrify();
let expected_external_user = ExternalUser {
name: "John",
age: 10,
address: ExternalAddress {
name: "somewhere out there",
phone: ExternalPhoneNumber {
main: 1234,
},
}
};
assert_eq!(external_user, expected_external_user);
Upgraded syn and quote versions in frunk_derives.
Upgraded syn and quote versions in frunk_derives.
Lock-step bump in versions for all libs to keep things straightforward.
A big step forward in terms of utility, ergonomics and correctness πΎ
A big step forward in terms of utility, ergonomics and correctness πΎ
All thanks to the addition of 2 main new contributors @Centril and @ExpHP π π
frunk now adheres to semantic versioning!frunk.frunk::prelude for extension traits and similar.Coproduct::embed and Coproduct::subset....tail argument in each of the HList and Coproduct macros.Func trait, an alternative to Fn that can be implemented on stable.Poly wrapper type and poly_fn! macro, which use Func to provide
order-free mapping.map_repr and map_intern for Generic, convenience methods for
temporarily converting an object into its generic representation or
a similar type.use what you need. Many of the other changes listed
help accomodate this.with-serde feature to serde, in line with convention.CoprodInjector, HMappable,
and HFold{Left,Right}able.hlist::IntoReverse to accompany Func in the new traits module.hlist::{Here, There, Suffixed} to a new indices module.Here is no longer an empty type. We have... plans.
:japanese_ogre:labelled to labelled::chars.list.to_ref().map(...),
where formerly as_ref() was used. The new to_ref() trait composes
orthogonally to many other features of HList and Coproduct, and relieves
frunk from providing impls for &HCons that can be susceptible to the
dreaded "Overflow evaluating _: std::marker::Sized" error.AsRef impls on HList and Coproduct, which were only
present to support the old as_ref().map(...) pattern.Adds Uninjector for Coprodcut, thanks @remexre
Prior to v0.2.0, frunk did not keep a detailed changelog, and did not adhere to semver.
The following list is a modest attempt to summarize the features of v0.1.36.
HLists and Coproducts, which serve as variadic product and sum types.
Generic and LabelledGeneric for conversions between similarly-shaped structs.
frunk_derives crate provides #[derive(Generic, LabelledGeneric)].Semigroup and Monoid, with a number of implementations.
frunk_laws crate provides quickcheck-compatible predicates for testing custom impls.hlist!, Hlist!, hlist_pat!, field!.Validated type, a non-short-circuiting alternative to Result.Nothing published for this version
Adds LiftFrom LiftInto for HLists as well as conversions to and from flat Tuples, thanks to @Centril !
Adds LiftFrom LiftInto for HLists as well as conversions to and from flat Tuples, thanks to @Centril !
Adds single-function mapping/foldl/foldr of HLists.
Adds single-function mapping/foldl/foldr of HLists.
Add a feature to optionally make HCons and HNil derive Serde traits.
Add a feature to optionally make HCons and HNil derive Serde traits.
Use newly released associated constant to power HList length.
Use newly released associated constant to power HList length.
Also, deprecate length(&self) -> u32 in favour of len(&self) -> usize.
Also, deprecate length(&self) -> u32 in favour of len(&self) -> usize.
Make sure structs declared in projects derive Hash thanks to @mglagla
Make sure structs declared in projects derive Hash thanks to @mglagla
Rename IntoCoproduct to CoprodInjector and use ::inject syntax for simplicity and consistency with other FP libs like Shapeless.
Rename IntoCoproduct to CoprodInjector and use ::inject syntax for simplicity and consistency with other FP libs like Shapeless.
Add #[inline(always)] to Sculptor method implementations to make LabelledGeneric::transform_from zero-cost.
Add #[inline(always)] to Sculptor method implementations to make LabelledGeneric::transform_from zero-cost.
test big_from_24fields ... bench: 109 ns/iter (+/- 49)
test big_from_25fields ... bench: 129 ns/iter (+/- 9)
test big_transform_from_24fields ... bench: 104 ns/iter (+/- 24)
test big_transform_from_25fields ... bench: 131 ns/iter (+/- 13)
Nothing published for this version
Non-consuming map and fold for HLists
Adds:
Nothing published for this version
Nothing published for this version
Rename LabelledGeneric's sculpted_convert_from to transform_from.
Rename LabelledGeneric's sculpted_convert_from to transform_from.
Nothing published for this version
Adds support for trailing commas in Hlist related macros (hlist!, Hlist! and hlist_pat!)
Adds support for trailing commas in Hlist related macros (hlist!, Hlist! and hlist_pat!)
Updates Sculptor exit type implementation to use HNil as the index. Zero effect on runtime, but offers clarity
Sculptor exit type implementation to use HNil as the index. Zero effect on runtime, but offers clarityNothing published for this version
Support unicode multicodepoint characters when encoding their type-level equivalents.
Support unicode multicodepoint characters when encoding their type-level equivalents.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixes derives not using up-to-date core
derives not using up-to-date coreYou can now: - Reverse an HList - Map over an HList - Fold over an HList
You can now:
Makes HList a Semigroup thanks to @tupshin π
Makes HList a Semigroup thanks to @tupshin π
Whereas Semigroup implementations for Tuples are written via macros for up to 26 elements, the HList Semigroup implementation is unbounded :)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.