title: Type 'T' is not assignable to type 'T'
body: <p>I am a seasoned javascript developer that recently learned C# as my first statically typed language. My next project is using typescript so I've been brushing up on it.</p>
  
  <p>This is my code:</p>
  
  <pre><code>interface IMonad&lt;T&gt; {
      get(): T;
      set&lt;T&gt;(fn: (value: T) =&gt; T): IMonad&lt;T&gt;;
  }
  
  class LazyMonad&lt;T&gt; implements IMonad&lt;T&gt;
  {
      private value: T;
      private binds;
  
      constructor(value: T)
      {
          this.value = value;
          this.binds = [];
      }
  
      get(): T
      {
          return this.binds
              .reduce(function (v: T, fn): T {
                  return (v === null) ? null : v + fn(v);
              }, this.value);
      }
  
      set&lt;T&gt;(fn: (value: T) =&gt; T): LazyMonad&lt;T&gt;
      {
          this.binds.push(fn);
          return this;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Edit: I also have this class that implements <code>IMonad&lt;T&gt;</code></p>
  
  <pre><code>class IdentityMonad&lt;T&gt; implements IMonad&lt;T&gt;
  {
      private value: T;
  
      constructor(value: T)
      {
          this.value = value;
      }
  
      get(): T
      {
          return this.value;
      }
  
      set&lt;T&gt;(fn: (value: T) =&gt; T): IdentityMonad&lt;T&gt;
      {
          return new IdentityMonad&lt;T&gt;(fn(this.value));
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Here is the error I'm getting from <code>tsc</code>:</p>
  
  <blockquote>
    <p>src/lazy_monad.ts(25,10): error TS2322: Type 'this' is not assignable
    to type 'LazyMonad'.   Type 'LazyMonad' is not assignable to
    type 'LazyMonad'.
        Type 'T' is not assignable to type 'T'.</p>
  </blockquote>
  
  <p>My implementation might be wrong here but I believe this would work in C#. Advice?</p>