9 releases

0.1.8 Apr 12, 2022
0.1.7 Sep 19, 2019
0.1.4 Aug 28, 2019

#2036 in Rust patterns

Apache-2.0

25KB
556 lines

funlib

Rust functional library

Just a lib to help me do some basic functional composition. Its still a work in progress


lib.rs:

Functional Libary for Rust

This is still a work in progess..

Functor

use funlib::Functor;

let s = Some(3).fmap(|&a| a * 2); // this will produce Some(6)

Monad

use funlib::Monad;

let s = Some(3).bind(|&a| Some(a * 2)); // this will produce Some(6)

Dependencies