Crate frunk [−] [src]
Frunk: generic functional programming toolbelt for Rust
Aims to be a collection of functional programming abstractions implemented in Rust in effective, useful, and idiomatic ways.
Here is a small taste of what Frunk has to offer:
use frunk::hlist::*; use frunk::monoid::*; use frunk::validated::*; // Combining Monoids let v = vec![Some(1), Some(3)]; assert_eq!(combine_all(&v), Some(4)); // HLists let h = hlist![1, "hi"]; assert_eq!(h.length(), 2); let (a, b) = h.into_tuple2(); assert_eq!(a, 1); assert_eq!(b, "hi");
Links: 1. Source on Github 2. Crates.io page
Modules
hlist |
Module that holds HList data structures and implementations |
monoid |
Module for holding Monoid typeclass definitions and default implementations |
semigroup |
Module for holding the Semigroup typeclass definition and typeclass instances |
validated |
Module for holding Validated logic |
Macros
Hlist |
Returns a type signature for an HList of the provided types |
hlist |
Returns an |
hlist_pat |
Macro for pattern-matching on HLists. |