Writing a strongly typed flip function in TypeScript I've talked about flip functions before. At the request of a reader, it's time to explore a more robust, strongly typed version. Let's dive in.
Understanding a catamorphism (by writing a simple one) A lot of the time, people haven't heard of catamorphisms, or misunderstand what it is. Let's make it simple, and better yet, let's write one on our own!
Understanding isomorphisms by writing some in TypeScript I have mentioned isomorphisms before, but left it at a high level. Is there only one isomorphism from a type to another? How do we write them? Time to dig in.
Why my functions are usually curried Most functions I write are curried. Some people are put off by its unfamiliarity, while others love it. Are you scared? Let's unmask the spooky ghost and see it for what it is, scooby-doo style.
Abstractions, composition, and modularity A lot of the time, code is about sharing ideas, in addition to solving problems. In code, ideas are most often expressed as abstractions. And solving a problem is usually building up a solution using several small ideas put together. Interested?
Building strongly typed vectors and matrices in TypeScript Recently, I came across a problem where I had to generate primitive Pythagorean triples. Much to the wrath of several people, I’m gonna…
Using TypeScript to write compile-time-safe enumeration type handlers Well written types enforce compile-time guarantees in your code that needs no tests to guarantee functional correctness. At the very least…
What you risk when using Number() to parse an integer from a string in TypeScript Using Number constructor function to parse a number from an input in TypeScript entails a couple of risks. It’s better to be aware of them.
Unit testing node applications with TypeScript — using mocha and chai TypeScript has gotten so much better in the last year, and so many projects have adopted it. But how do you write your tests in TypeScript? TypeScript has gotten so much better in the last year, and so many new applications and projects are built on top its awesomeness. But how do you write your te
Write tests for TypeScript projects with mocha and chai — in TypeScript! UPDATE: There’s a newer version of this post, with more details and solutions. It’s advisable to head there instead. The contents of this…