Overview#
Slang Ts is an opinionated functional programming library for TypeScript. It is published on npm as slang-ts, and it brings utilities over from languages like Rust and Erlang.
Why I Made It#
I love functional programming, and I prefer functions and composition over classes and inheritance. The main reason I made this was simpler. The libraries I found felt too complicated, and they demanded a lot of background knowledge before you could be productive.
I wanted something I could work with comfortably, something I could teach a team in an evening, one utility at a time.
How It Works#
Instead of throwing, a function that can fail returns a Result. An Ok holds the value and an Err holds a message. The caller checks isOk before reading either one.
I aimed for practicality over correctness. Some functions are not pure, and a few rules are broken on purpose. That is what makes it fun to use.
Installation#
Install it with npm i slang-ts, then import only the utilities you use.