title: Another rust generics exercise
body: <p>I'm trying to implement a Monad like trait in Rust. Mostly just for fun and to get familiar with the type system. I'm pretty sure I will not be able to fully implement a Monad trait due to the lack of "higher kinds" as explained in this <a href="http://www.reddit.com/r/rust/comments/1a57pw/haskeller_playing_with_rust_a_question_about/" rel="nofollow noreferrer">reddit discussion</a>, but I want to see how close I can get. For some reason I can't get this code to compile. Seems like it should. Can someone explain why?</p>
  
  <pre><code>trait Monad&lt;T&gt; {
      fn lift(val: T) -&gt; Self;
  }
  
  struct Context&lt;T&gt;{ 
      val: T 
  }
  
  impl&lt;T&gt; Monad&lt;T&gt; for Context&lt;T&gt; {
      fn lift(x: T) -&gt; Context&lt;T&gt; {
          Context{val: x}
      }
  }
  
  fn main() { 
      let c:Context&lt;int&gt; = Context&lt;int&gt;::lift(5i);
  }
  </code></pre>