Id functor Typescript

by dimitrs_papadimitriou

TypeScript

//
class Id<T> {
  Value: T;

  constructor(value: T) {
    this.Value = value;
  }

  map<T1>(f: (y: T) => T1): Id<T1> {
    return new Id<T1>(f(this.Value));
  } 
 
}