aviary 0.1.1

Aviary bird combinators for Rust.
Documentation
  • Coverage
  • 98%
    49 out of 50 items documented0 out of 49 items with examples
  • Size
  • Source code size: 26.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fwrs

Rust Aviary

This crate is a reimplementation of Haskell's Data.Aviary combinators in Rust.

Installation

Add the following to the [dependencies] section of your Cargo.toml:

aviary = "0.1.0"

Documentation

Available at docs.rs

Example: Palindrome checker

Let's define some helper functions:

let eq = &(|x: String, y: String| PartialEq::eq(&x, &y)) as &Fn(String, String) -> bool;
let reverse = |x: String| x.chars().rev().collect::<String>();

And make a function using the starling combinator:

let is_palindrome = starling(&eq, &reverse);

Make sure our function is correct:

assert!(is_palindrome("nisumaa oli isäsi ilo aamusin".to_string()));

Contributing

Any contributions are welcome.