frunk
frunk copied to clipboard
Funktional generic type-level programming in Rust: HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid and friends.
I had a go at writing a `try_pluck` method on HList. It would return `Some` if the type is in the list, or `None` if it isn't. But I wasn't...
Hi, I just started using this crate and looks quite promising! I want to check if there is some limitation with the crate or maybe I'm doing something wrong. Here...
Closes #180. Things to do before this draft PR could be made an actual PR: - [x] Implementation - [x] Tests - [x] ~~Bikeshedding inherent methods. Do we want to...
### Reasons to have it The main reason to have it is performance. 1. Destructing `HCons` into `H` and `T` copies both `H` and `T`. 2. Destructing `&HCons` into `&H`...
If #137 gets merged, then `Func` will take no context while `FuncMut` takes a `&mut` context. For consistency, `Func` should be revised to take a `&self` context. IMO, `poly_fn!` still...
This is possible with nightly rust with features. See https://www.fpcomplete.com/blog/monads-gats-nightly-rust/.
This also makes `HMappable` accept `FnMut` instead of just `Fn`; I don't believe this would be breaking, but I can split it out if it is.
At the moment it only works for direct implementations of `LabelledGeneric` which makes it slightly awkward to get the labelled generic representation of a reference to a struct.
So, obviously, `struct`s are to `HList`s as `enum`s are to `Coproduct`s. Frunk has both of these data types, so why doesn't it implement `Generic` for enums yet? After thinking about...
After #144 goes through we should add impls of LabelledGeneric for tuples.