DEV Community

Discussion on: Why TypeScript is a better option than JavaScript when it comes to functional programming?

Collapse
 
avalander profile image
Avalander

When I write libraries meant to be imported in other projects I usually write type definition files for the public interface, since some typing is still better than no typing, but I do feel that TypeScript is considerably lacking when it comes to typing functional constructs. I wish that TypeScript had brought us algebraic data types and pattern matching instead of classes and private methods.

Collapse
 
darcyrayner profile image
Darcy Rayner

Typescript doesn't have algebraic data types? It has type unions and intersections. What else does it need to qualify?

Totally agree pattern matching would be awesome though.