Id functor Typescript
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));
}
}
//
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));
}
}