Cpp Functional Programming In Typescript