Skip to content

A crate providing a trait for performing currying (and non-currying) function-composition in rust.

License

Notifications You must be signed in to change notification settings

sigurd4/currycompose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

currycompose

A crate providing a trait for performing currying (and non-currying) function-composition in rust.

A can be composed with B if A implements FnOnce and takes one or more argument, while B implements FnOnce and returns something of the same type as the first argument of A.

  • For instance (A, B) -> Y can be composed with (C) -> A, yiedling (B, C) -> Y (currying).

  • Composing (A, B) -> Y with (C) -> A then with (D) -> B yields (C, D) -> Y (currying twice).

  • While of course (A) -> Y composed with (B) -> A, yields (B) -> Y as expected (non-currying composition).

Currying functions which implement FnMut or Fn will yield something also implementing FnMut/Fn if both operands do.

About

A crate providing a trait for performing currying (and non-currying) function-composition in rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages