From adb1754e4dcbf61abb93ac7604aed4e8bca080a8 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 3 Nov 2010 17:10:37 -0700 Subject: Move the option type to its own module --- src/lib/util.rs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/lib/util.rs') diff --git a/src/lib/util.rs b/src/lib/util.rs index f6e1327b..72844d5f 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -1,21 +1,3 @@ -tag option[T] { - none; - some(T); -} - -type operator[T, U] = fn(&T) -> U; - -fn option_map[T, U](&operator[T, U] f, &option[T] opt) -> option[U] { - alt (opt) { - case (some[T](?x)) { - ret some[U](f(x)); - } - case (none[T]) { - ret none[U]; - } - } -} - fn id[T](&T x) -> T { ret x; } -- cgit v1.2.3