Skip to content

Commit 4619d30

Browse files
committed
---
yaml --- r: 7023 b: refs/heads/master c: e11d207 h: refs/heads/master i: 7021: 7c1be13 7019: d1a9143 7015: 9c35b63 7007: 38503e6 v: v3
1 parent 961c689 commit 4619d30

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: a7e1a35f8836f78894a4499ac7bebcc76472f172
2+
refs/heads/master: e11d20711335111073826d7b553ca4839c590a04

trunk/src/libcore/either.rs

+18
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ pure fn to_result<copy T, copy U>(eith: t<T, U>) -> result::t<U, T> {
103103
}
104104
}
105105

106+
/*
107+
Function: is_left
108+
109+
Checks whether the given value is a left
110+
*/
111+
pure fn is_left<T, U>(eith: t<T, U>) -> bool {
112+
alt eith { left(_) { true } _ { false } }
113+
}
114+
115+
/*
116+
Function: is_left
117+
118+
Checks whether the given value is a right
119+
*/
120+
pure fn is_right<T, U>(eith: t<T, U>) -> bool {
121+
alt eith { right(_) { true } _ { false } }
122+
}
123+
106124
//
107125
// Local Variables:
108126
// mode: rust

0 commit comments

Comments
 (0)