Generic type aliases

With TypeScript 1.6, type aliases can be generic. For example:

  1. type Lazy<T> = T | (() => T);
  2. var s: Lazy<string>;
  3. s = "eager";
  4. s = () => "lazy";
  5. interface Tuple<A, B> {
  6. a: A;
  7. b: B;
  8. }
  9. type Pair<T> = Tuple<T, T>;