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");

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 an HList based on the values passed in.