about summary refs log tree commit diff
path: root/src/lib/either.rs
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2011-08-12 06:37:10 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-08-16 15:05:56 -0700
commit4c9049c50c5c32f556eaefbcc50209ef8ee353d0 (patch)
treebfb83e800b3ebbba65beb080dad463f72da4ac73 /src/lib/either.rs
parent21f46a1655f2a026546792546b07dec9e039ec54 (diff)
downloadrust-4c9049c50c5c32f556eaefbcc50209ef8ee353d0.tar.gz
rust-4c9049c50c5c32f556eaefbcc50209ef8ee353d0.zip
Port the stdlib to the decl foo<T> syntax.
Diffstat (limited to 'src/lib/either.rs')
-rw-r--r--src/lib/either.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/either.rs b/src/lib/either.rs
index 78496bec917..95f1d9aca21 100644
--- a/src/lib/either.rs
+++ b/src/lib/either.rs
@@ -3,14 +3,14 @@ import option;
 import option::some;
 import option::none;
 
-tag t[T, U] { left(T); right(U); }
+tag t<T, U> { left(T); right(U); }
 
-fn either[T, U, V](f_left: &block(&T) -> V, f_right: &block(&U) -> V,
+fn either<T, U, V>(f_left: &block(&T) -> V, f_right: &block(&U) -> V,
                    value: &t<T, U>) -> V {
     alt value { left(l) { f_left(l) } right(r) { f_right(r) } }
 }
 
-fn lefts[T, U](eithers: &[t<T, U>]) -> [T] {
+fn lefts<T, U>(eithers: &[t<T, U>]) -> [T] {
     let result: [T] = ~[];
     for elt: t<T, U> in eithers {
         alt elt { left(l) { result += ~[l] } _ {/* fallthrough */ } }
@@ -18,7 +18,7 @@ fn lefts[T, U](eithers: &[t<T, U>]) -> [T] {
     ret result;
 }
 
-fn rights[T, U](eithers: &[t<T, U>]) -> [U] {
+fn rights<T, U>(eithers: &[t<T, U>]) -> [U] {
     let result: [U] = ~[];
     for elt: t<T, U> in eithers {
         alt elt { right(r) { result += ~[r] } _ {/* fallthrough */ } }
@@ -26,7 +26,7 @@ fn rights[T, U](eithers: &[t<T, U>]) -> [U] {
     ret result;
 }
 
-fn partition[T, U](eithers: &[t<T, U>]) -> {lefts: [T], rights: [U]} {
+fn partition<T, U>(eithers: &[t<T, U>]) -> {lefts: [T], rights: [U]} {
     let lefts: [T] = ~[];
     let rights: [U] = ~[];
     for elt: t<T, U> in eithers {