moreops
A set of useful simple additional methods
Usage:
[]
= "*"
Examples:
use *;
// Simple wrapping into Option
let some_num = 123.some;
let none_num = ;
// Simple wrapping into Result
let ok = 123.ok;
let err = "Error!".to_owned.err;
// If-like operations with Option
let x = 42;
let answer = .option.unwrap_or;
// Tap into some result (like `<|` and `|>` operators from Scalaz)
assert_eq!;
assert_eq!;
// Swap result
assert_eq!;
assert_eq!;
// Apply functions to tuples of args directly
let x = .apply;
assert_eq!;
// Use twice() to build map
let map = .map.;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.