2012-06-26 05:00:46 +02:00
|
|
|
impl monad<A> for [A]/~ {
|
|
|
|
fn bind<B>(f: fn(A) -> [B]/~) {
|
2012-04-08 02:11:33 +02:00
|
|
|
let mut r = fail;
|
|
|
|
for self.each {|elt| r += f(elt); }
|
|
|
|
//!^ WARNING unreachable expression
|
|
|
|
//!^^ ERROR the type of this value must be known
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
["hi"].bind {|x| [x] };
|
|
|
|
}
|