https://github.com/lambda-fairy/origami
Folding utilities
https://github.com/lambda-fairy/origami
Last synced: over 1 year ago
JSON representation
Folding utilities
- Host: GitHub
- URL: https://github.com/lambda-fairy/origami
- Owner: lambda-fairy
- Created: 2015-02-05T04:14:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-21T08:53:06.000Z (almost 11 years ago)
- Last Synced: 2025-03-17T11:59:20.291Z (over 1 year ago)
- Language: Rust
- Size: 168 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Origami [](http://travis-ci.org/lfairy/origami)
Folding utilities.
A [fold][] is when you reduce a collection down to a summary value. Many iterator methods, like `.count()`, `.sum()`, `.max()` etc., are folds.
However the folds in the standard library, while easy to use, are not very flexible. They work strictly from left-to-right, and cannot run in parallel.
This library provides an alternative formulation of these folds, in terms of [semigroups][] and [monoids][]. These structures decouple the core operation ("what") from the execution strategy ("how"), giving you more control over how your folds run.
[fold]: https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29
[monoids]: https://en.wikipedia.org/wiki/Monoid
[semigroups]: https://en.wikipedia.org/wiki/Semigroup