Crate rust2fun

source ·
Expand description

A library for functional programming in Rust

Modules

Macros

  • Macro to implement AndThen for types implementing a FlatMap::flat_map.
  • Macro to implement Apply for types with Iterator support.
  • Bind macro. Allows for a more natural syntax for monadic composition. It is similar to the do notation in Haskell or the for notation in Scala.
  • Compose functions.
  • The constant with no arguments constant(x) = () -> x.
  • The constant function constant1(x) = _ -> x also known as K (Kestrel) combinator.
  • The constant function with two arguments constant2(x) = (_, _) -> x.
  • The constant function with 3 arguments constant3(x) = (_, _, _) -> x.
  • The constant function with 4 arguments constant4(x) = (_, _, _, _) -> x.
  • The constant function with 5 arguments constant5(x) = (_, _, _, _, _) -> x.
  • The constant function with 6 arguments constant6(x) = (_, _, _, _, _, _) -> x.
  • The constant function with 7 arguments constant7(x) = (_, _, _, _, _, _, _) -> x.
  • The constant function with 8 arguments constant8(x) = (_, _, _, _, _, _, _, _) -> x.
  • The constant function with 9 arguments constant9(x) = (_, _, _, _, _, _, _, _, _) -> x.
  • The constant function with 10 arguments constant10(x) = (_, _, _, _, _, _, _, _, _, _) -> x.
  • The constant function with 11 arguments constant11(x) = (_, _, _, _, _, _, _, _, _, _, _) -> x.
  • The constant function with 12 arguments constant12(x) = (_, _, _, _, _, _, _, _, _, _, _, _) -> x.
  • Curry a function of two arguments. The first argument is applied to the function. The second argument is returned as a closure. The returned closure can be applied to the second argument. The result is the same as applying the function to both arguments.
  • Curry a function of 3 arguments.
  • Curry a function of 4 arguments.
  • Curry a function of 5 arguments.
  • Curry a function of 6 arguments.
  • Curry a function of 7 arguments.
  • Curry a function of 8 arguments.
  • Curry a function of 9 arguments.
  • Curry a function of 10 arguments.
  • Curry a function of 11 arguments.
  • Curry a function of 12 arguments.
  • Macro to implement FlatMap for types with Iterator support.
  • Flip arguments of a function flip(f)(x, y) = f(y, x) also known as C (Cardinal) combinator.
  • Macro to implement Functor for types with Iterator support.
  • Macro implementing Higher for a given type of kind * -> *.
  • Macro to implement Invariant for types implementing a contravariant Functor.
  • Macro to implement Invariant for types implementing Functor.
  • Creates a NEVec containing the arguments.
  • Pipe functions.
  • Macro to implement Semigroup for types with append method.
  • Macro to implement Semigroup for types with extend method.
  • Macro to implement Semigroupal for types with Iterator support.