tear 0.5.1

Typed early returns and loop control + Syntax sugar for try!-like error handling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Testing the "combinators" feature
#![cfg(feature = "combinators")]

use tear::prelude::*;
use tear::Judge;
use either::Either::*;

#[test] fn side_works () {
	let v :ValRet<_, ()> = Val(2);

	let v = v.side().map_left(|_| 46).map_right(|x| x * 2);
	assert_eq![ v, Right(4) ];
}