interface Container<T> { map<U>(f: (x: T) => U): Container<U> }
const box: Container<number> = createBox(5)
box.map(x => x.toString()) // Container<string>A generic Container interface with a map method models the Functor pattern from functional programming.
Challenge: Implement createContainer<T>(value) returning a Container<T> with a map method for transformation.
createContainer(5).map(x => x * 2).value // β 10
createContainer('hi').map(s => s.length).value // β 2