| Crates.io | rustkell |
| lib.rs | rustkell |
| version | 0.2.2 |
| created_at | 2017-10-04 12:13:52.530567+00 |
| updated_at | 2017-10-04 15:39:33.65782+00 |
| description | Rustkell is haskell like functions in rust. |
| homepage | https://github.com/AnickaBurova/rustkell |
| repository | https://github.com/AnickaBurova/rustkell |
| max_upload_size | |
| id | 34377 |
| size | 8,524 |
More functions will come as I will need them.
tails: The tails function returns all final segments of the list, longest first.
Cargo.toml
[dependencies]
rustkell = "0.2"
main.rs
extern crate rustkell;
use rustkell::DataList;
use std::iter::Iterator;
fn main() {
let v = vec![1,2,3,4];
for t in v.tails() {
println!("{:?}", t);
}
}
Output:
> [1, 2, 3, 4]
> [2, 3, 4]
> [3, 4]
> [4]
> []
Licensed under the MIT license, see LICENSE